Ad Widget

Collapse

Custom scripts fed into actions comments

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cbidwell
    Senior Member
    • Aug 2006
    • 127

    #1

    Custom scripts fed into actions comments

    I've got a script that writes to a file whenever a specific server can't access multiple other servers over a period of time. The contents of the text of that file I would like to somehow import into a zabbix action and emailed out. Right now, I'm running in my zabbix_agentd.conf:

    UserParameter=EQ.Monitor_wkg,cat /home/quake/REQS_monitor/logdir/zabbix.LOG | grep "RECENTEQS_Working" | cut -d: -f2 | sed "s/\s//g"

    Which results in a 0 or a 1.

    So in the rest of this zabbix.LOG file I have this:

    RECENTEQS_Working: 0
    server1 - Mon Mar 16 18:29:46 UTC 2009 - Uptime: 11:31:07 up 1:37, 2 users, load average: 2.31, 2.26, 2.08 - Rsyncs: 6
    Problems:
    Slow response (> 5 seconds) for 5 times from: server2/recenteqs/ (10.1.1.1)
    Slow response (> 5 seconds) for 6 times from: server3/recenteqs/ (10.1.1.2)


    See: http://serveraddress/mostrecent_summary.html

    How can I get the information in blue to pull into an action comment?
  • cbidwell
    Senior Member
    • Aug 2006
    • 127

    #2
    Does anyone have any clue how to do this? Can it be done? Am I just missing something obvious?

    Comment

    • td3201
      Junior Member
      • Nov 2008
      • 25

      #3
      Can you utilize the system.run item then pass the contents of that output into your action as a macro? Maybe it's the {ITEM.LASTVALUE} macro?

      system.run[cat /home/quake/REQS_monitor/logdir/zabbix.LOG | grep "RECENTEQS_Working" | cut -d: -f2 | sed "s/\s//g]

      Comment

      • cbidwell
        Senior Member
        • Aug 2006
        • 127

        #4
        Thank you for the reply, so do I need to create a new "item" putting the system.run[cmd] in there or does that system.run go into the comments of the action?

        Comment

        • td3201
          Junior Member
          • Nov 2008
          • 25

          #5
          A new item. The item is what pulls the information. From there you can create a trigger which fires off the email action.

          Comment

          Working...