Ad Widget

Collapse

Triggers with SNMP Traps

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • grash
    Junior Member
    • Oct 2009
    • 14

    #1

    Triggers with SNMP Traps

    Hi Forum!!

    This is my first post.

    I am monitoring several switches with snmp traps. They send a trap when temperature is higher than threshold, the OID I get "OID: SNMPv2-SMI::enterprises.52.11004".

    Good, I get the trigger and actions associated.

    But, when the temp on the switch is lower than threshold, the trap it sends is "OID: SNMPv2-SMI::enterprises.52.11008"

    The first trigger is ON (cause the trap is different), but the temp is correct...

    This is the trigger: "snmptraps.str(SNMPv2-SMI::enterprises.52.11004)}=0"

    Anybody knows how to associate the traps to the same trigger in order to get consistent states?

    Any other solution??? Maybe differente trigger??

    Thanks in advance and best regards,


    Olaf Marcos
  • MrKen
    Senior Member
    • Oct 2008
    • 652

    #2
    With snmptraps you need to define a separate trigger for each trap because the string is going to be different!

    Probably would be better, and more consistent, if your triggger expression had string=1

    "snmptraps.str(SNMPv2-SMI::enterprises.52.11004)}=1"

    "snmptraps.str(SNMPv2-SMI::enterprises.52.11008)}=1"

    MrKen

    P.S. I hate snmptraps!
    Disclaimer: All of the above is pure speculation.

    Comment

    • grash
      Junior Member
      • Oct 2009
      • 14

      #3
      Thanks MrKen.

      But I see a problem with this config.

      When the triggers are going to "off"???

      If I get a trap with High Temp (enterprises.52.11004), this trigger is not set to off until ......????

      The only solution I think could be:

      One trigger when I get trap with High Temp and
      Second Trigger when I get trap with Normal Temp, and in the actions of this trigger tell the First Trigger that is Ok.

      But, can an action modify another trigger????

      Greetings,


      Olaf Marcos

      Comment

      • MrKen
        Senior Member
        • Oct 2008
        • 652

        #4
        Resetting the snmptrap trigger has been discussed on the forum in the past. Take a look at the end of this post for a solution http://www.zabbix.com/forum/showpost...74&postcount=1

        Otherwise search the forum for more ideas.

        HTH
        MrKen
        Disclaimer: All of the above is pure speculation.

        Comment

        • richlv
          Senior Member
          Zabbix Certified Trainer
          Zabbix Certified SpecialistZabbix Certified Professional
          • Oct 2005
          • 3112

          #5
          Originally posted by grash
          This is the trigger: "snmptraps.str(SNMPv2-SMI::enterprises.52.11004)}=0"
          wait, if you manage to get traps from each host into a separate item, that's the hardest part already done.
          the trigger expression you pasted should actually work - if the last value does not match that string, it should go off.
          one problem could be if the device sends other traps as well, in which case you would need to make sure that traps representing temperature go into single item and nothing else goes there.
          Zabbix 3.0 Network Monitoring book

          Comment

          • grash
            Junior Member
            • Oct 2009
            • 14

            #6
            Originally posted by richlv
            one problem could be if the device sends other traps as well, in which case you would need to make sure that traps representing temperature go into single item and nothing else goes there.
            I have traps from each host into a separate item.

            Devices sends other traps, but how to send temp traps into sigle item??

            I don't understand well what you mean...

            Best regards,


            Olaf

            Comment

            • richlv
              Senior Member
              Zabbix Certified Trainer
              Zabbix Certified SpecialistZabbix Certified Professional
              • Oct 2005
              • 3112

              #7
              separating traps in items has to be done by the method you push them into zabbix.
              i've had custom scripts for that, for example.
              Zabbix 3.0 Network Monitoring book

              Comment

              • grash
                Junior Member
                • Oct 2009
                • 14

                #8
                Originally posted by richlv
                separating traps in items has to be done by the method you push them into zabbix.
                i've had custom scripts for that, for example.

                Thanks for the tip richlv.

                But although I put the traps on separate items. ¿How to relation one item with the other?

                I mean:
                I got a trap on item "temp.violated"(SNMPv2-SMI::enterprises.52.11004) and got another trap on the other item "temp.ok"(SNMPv2-SMI::enterprises.52.11008).

                The question is: how to tell the first item that temp is ok and to switch off the trigger? The first item/trigger will go on when it receives "SNMPv2-SMI::enterprises.52.11004", but if I separate items, is the only trap that will receive, so, how to switch off???
                The device(switch) only send one trap when the temp is higher than threshold and only one trap when the temp is lower than threshold.

                Do you understand???

                Thanks and regards,


                Olaf Marcos

                Comment

                • richlv
                  Senior Member
                  Zabbix Certified Trainer
                  Zabbix Certified SpecialistZabbix Certified Professional
                  • Oct 2005
                  • 3112

                  #9
                  for now i'm not aware of another possibility than sorting traps before passing them to zabbix and in this case pushing on/off traps into single item.
                  i can imagine a good feature request though - trigger function 'lastupdate' or similar.
                  it would return last unix timestamp when an item has received data. this would be very helpful in your case - you could simply compare timestamps from two triggers.
                  could you please report this on the feature request tracker ?
                  Zabbix 3.0 Network Monitoring book

                  Comment

                  • grash
                    Junior Member
                    • Oct 2009
                    • 14

                    #10
                    Originally posted by richlv
                    for now i'm not aware of another possibility than sorting traps before passing them to zabbix and in this case pushing on/off traps into single item.
                    i can imagine a good feature request though - trigger function 'lastupdate' or similar.
                    it would return last unix timestamp when an item has received data. this would be very helpful in your case - you could simply compare timestamps from two triggers.
                    could you please report this on the feature request tracker ?
                    I would request an easier trigger function:
                    last.str.on="enterprises.52.11004" && last.str.off="enterprises.52.11008"

                    The trigger go on when last value map to last.str.on and go off when map the last.str.off

                    What you think??

                    Best regards,


                    Olaf Marcos

                    Comment

                    • grash
                      Junior Member
                      • Oct 2009
                      • 14

                      #11
                      Wooooouuu !!!

                      Just a moment... Inspiration...

                      Take it easy!!!

                      If I send traps to the same item, I could set this trigger:

                      "snmptraps.str(SNMPv2-SMI::enterprises.52.11008)}=0"

                      It means (I think), if the last str value not = "enterprises.52.11008" (Temp OK) trigger ON.

                      If I receive a "52.11008" the trigger will go OFF, won't go?

                      The only problem is to force the devices to send at least one "52.11008". But, this is my problem...

                      Feedback????

                      Regards,

                      Olaf Marcos

                      Comment

                      • richlv
                        Senior Member
                        Zabbix Certified Trainer
                        Zabbix Certified SpecialistZabbix Certified Professional
                        • Oct 2005
                        • 3112

                        #12
                        is that intended for one or for two separate item config ?
                        i don't see how it could work with two separate items. if you have single item for these two traps, simply checking on the last data would suffice.
                        Zabbix 3.0 Network Monitoring book

                        Comment

                        • grash
                          Junior Member
                          • Oct 2009
                          • 14

                          #13
                          Hi richlv !

                          I don't see it with only one item too.

                          Do you have any script example of how to manage traps with several items??

                          Thanks in advance and best regards,


                          Olaf Marcos

                          Comment

                          Working...