Ad Widget

Collapse

Trigger Help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • esawyja
    Member
    Zabbix Certified Specialist
    • Dec 2011
    • 54

    #1

    Trigger Help

    I have a script that checks a number of processes and will return a 0 when all is ok and 1 when all is not ok, it works fine with
    zabbix_get -s xxxxxxxxxxxxxxx -p 10050 -k system.run["/etc/zabbix/scripts/roro.sh"]
    1
    But the trigger does not seem to work, as far as I can understand, is that the trigger will compare the value that it has in the DB with the value that comes in and will trigger is there is a diff? My trigger is defined as
    system.run["/etc/zabbix/scripts/roro.sh"].last(0)}#0, so if the output of the script is not equal to zero, it should trigger? It does, but then when the scripts runs again, when the value in DB is 1 and the next value is 1, the alarm clears. Can anyone assist? Please
  • Davidus
    Senior Member
    • Dec 2010
    • 281

    #2
    Originally posted by esawyja
    I have a script that checks a number of processes and will return a 0 when all is ok and 1 when all is not ok, it works fine with
    zabbix_get -s xxxxxxxxxxxxxxx -p 10050 -k system.run["/etc/zabbix/scripts/roro.sh"]
    1
    But the trigger does not seem to work, as far as I can understand, is that the trigger will compare the value that it has in the DB with the value that comes in and will trigger is there is a diff? My trigger is defined as
    system.run["/etc/zabbix/scripts/roro.sh"].last(0)}#0, so if the output of the script is not equal to zero, it should trigger? It does, but then when the scripts runs again, when the value in DB is 1 and the next value is 1, the alarm clears. Can anyone assist? Please
    well, being honest I don’t like that you closing curly bracket in your expression } even though you have never opened one {

    try,
    {HOSTNAME:system.run["/etc/zabbix/scripts/roro.sh"].last(0)}#0
    this is my guess
    Last edited by Davidus; 21-12-2011, 15:24.

    Comment

    • esawyja
      Member
      Zabbix Certified Specialist
      • Dec 2011
      • 54

      #3
      Sorry yes the hostname is included, I just copied the important stuff

      or rather the template

      {Template_Linux_001:system.run["/etc/zabbix/scripts/roro.sh"].last(0)}#0

      and yes the host is part of the template

      {xx.xxx.xxx-SAS-xxx-xxxx 4.xx.xxx:system.run["/etc/zabbix/scripts/roro.sh"].last(0)}#0
      Last edited by esawyja; 21-12-2011, 15:31.

      Comment

      • Davidus
        Senior Member
        • Dec 2010
        • 281

        #4
        I`m using pretty much similar trigger and its work fine
        {SERV1:telnet.run[hroot,172.30.141.150].last(0)}>90

        try >0 instead of #0
        taking a guess again

        Comment

        • Davidus
          Senior Member
          • Dec 2010
          • 281

          #5
          Try to avoid spaces in your trigger expression!
          I see one space here:
          {xx.xxx.xxx-SAS-xxx-xxxx 4.xx.xxx:system.run["/etc/zabbix/scripts/roro.sh"].last(0)}#0

          Comment

          • esawyja
            Member
            Zabbix Certified Specialist
            • Dec 2011
            • 54

            #6
            Ok I have removed all spaces, tried >0, #0...., No luck.
            What happens is that when Zabbix sees the change, IE, it changes from 0 to 1, the alarm triggers, but then when the next run off the script occur, the output from the script is still 1, Zabbix seems to compare what was peviously with what is now, if there is no change, the alarm will clear, what I need is a trigger that will activate the alarm if the output from the script is 1 and maintain the alarm for as long as the output from the script is 1.... Please help, I'm loosing my hair over this....

            Comment

            • Davidus
              Senior Member
              • Dec 2010
              • 281

              #7
              Originally posted by esawyja
              Zabbix seems to compare what was peviously with what is now, if there is no change, the alarm will clear
              Basically this happens with diff



              My advice would be following, try to create brand new trigger
              Don’t create these trigger in/for template, create it directly in host

              Comment

              • esawyja
                Member
                Zabbix Certified Specialist
                • Dec 2011
                • 54

                #8
                Thanks, I deleted all and recreated all, now it seems to work....

                Comment

                • Davidus
                  Senior Member
                  • Dec 2010
                  • 281

                  #9
                  You are welcome

                  Comment

                  Working...