Ad Widget

Collapse

Trigger for SNMP Trap Items

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fcostasilva
    Junior Member
    • Nov 2012
    • 2

    #1

    Trigger for SNMP Trap Items

    Hello everyone,
    I'm quite new to the zabbix world and this is my first post here. I have some snmp traps related to UPS Devices and I want, as they come, to execute some scripts based on triggers registered on zabbix. I created an item for my host which type is snmp trap, but every time a trigger comes, its status change to "not monitored". And I created a trigger that has never been fired(don't know if it's because of the status of the item).
    For example:
    I have an attribute called upsEstimatedMinutesRemaining for the following trap:

    upsTrapOnBattery .1.3.6.1.2.1.33.2.1

    I want to create a trigger that is fired when upsEstimatedMinutesRemaining is less then, let's say, 5.
    For testing, I'm sending traps using the snmptrap command as below:

    sudo snmptrap -v 2c -c public localhost "" .1.3.6.1.2.1.33.2.1 upsEstimatedMinutesRemaining int 4

    When I go to check on zabbix, I can see an red icon on status, which is able to show the latest trap. However, no trigger is fired and when I go to the "latest data" section, no result is there.

    I know that it's a common and newbie question, but it seems zabbix has changed a lot from 1.8 to 2.0 and most of the documentation on the internet is out of date.

    I have also looked for a book, but the most recent was released in 2010.

    I really, really appreciate any suggestion, any path, any link you can share.

    I have to point out that I'm not a system's administrator. I'm a software developer working on a customized zabbix frontend.
     
  • Speedfight
    Member
    • May 2007
    • 67

    #2
    if there is no result in recent data, i think your item is bad. (you don't need to use snmptrap command to send data to zabbix)

    try snmpget for the OID if you are pulling data from the ups.

    when you have your item you can create a trigger on that item.

    put a tail -f on /tmp/zabbix_server.log

    disable the item then re enable it. you can see in the log what is going wrong

    Comment

    • fcostasilva
      Junior Member
      • Nov 2012
      • 2

      #3
      I managed to fix(well, more or less). In fact, my expression was wrong. It's a bit hard to create your expression only reading the documentation. Anyway... It's almost working. I saw on the internet that a trigger is fired only when some state changes. It means that if a receive 10 traps sequentially with the same value, it will be fired only once. Is there a way to prevent this behaviour?

      Comment

      Working...