Ad Widget

Collapse

Please help with Zabbix trap

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zzBernie
    Junior Member
    • Apr 2015
    • 14

    #1

    Please help with Zabbix trap

    Using Zabbix 2.2.8 on CentOS 6.7, I've created a trap to capture data sent to it using zabbix_sender in a shell script from a remote host. This shell script outputs state information using "top" among other tools, to a file. This file is then read and sent back to the trap to populate the host.state key like:

    /usr/bin/zabbix_sender -z sis-mon-prod.mydomain.net -s $thishost -k host.state -o "$statefile"

    Then under Configuration -> Actions, I have modified the "Report problems to Zabbix administrators" trigger to include the data from the host.state key like this, which includes the host state information in the Zabbix alert email:

    Host State Information: {{HOST.HOST}:host.state.last()}

    The problem is that the data sent in the email is the PREVIOUS value of host.state. using the last() function does not include the current data in the host.state.last().

    Is there another function I could use to get the current data from the host.state trap key? Or is there a different approach I could that when a zabbix alert is triggered, I can grab the current state of the server using top, iotop, etc., and include that in the zabbix alert?

    -Thanks
Working...