Ad Widget

Collapse

Help me with a Trigger

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • llama
    Junior Member
    • Mar 2005
    • 13

    #1

    Help me with a Trigger

    I have a basic shell script that does a check on my linux boxes and writes either a 1 or a 0 to a log file.

    Item:
    log["/tmp/zabbix.urpmi.status","1|0","UTF-8",1]

    I want this item to trigger if the logfile has a 1 at the bottom

    Trigger:
    {Hostname:log["/tmp/zabbix.urpmi.status","1|0","UTF-8",1].diff(0)}=0

    diff(0)}=0 I can not seem to find the correct value to put here, to activate if the log has a 1 at the bottom not a 0

    plz help me fix this basic issue that is driving me insane!
    Last edited by llama; 23-09-2010, 19:27. Reason: bold some shiz
  • llama
    Junior Member
    • Mar 2005
    • 13

    #2
    last(0)}=1

    I think this is what I needed.

    Comment

    • bashman
      Senior Member
      • Dec 2009
      • 432

      #3
      why don't you use the UserParameters option on zabbix_agentd.conf file?.

      You just have to modify your script to exit with the number that is written to the log.

      UserParameter=your.key,/the/path/to/your/script.sh;echo $?
      978 Hosts / 16.901 Items / 8.703 Triggers / 44 usr / 90,59 nvps / v1.8.15

      Comment

      Working...