Ad Widget

Collapse

How the field "value" in the trigger object is determined?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mishta
    Junior Member
    • Aug 2018
    • 6

    #1

    How the field "value" in the trigger object is determined?

    Hi,
    Can someone please explain to me how the field "value" in the trigger object is determined? is it the result of the expression? and is there a way to override the way it is determined?

    Thanks
  • 1berto
    Senior Member
    • Sep 2018
    • 182

    #2
    Do you mean the value of a item? or some macro like {EVENT.VALUE} ?

    Comment

    • mishta
      Junior Member
      • Aug 2018
      • 6

      #3
      Thanks for the response.
      I will elaborate:
      I am monitoring the number of running instances of a process, let’s call the process “myApp”.
      I have configured a trigger that supposed to be fired each time the number of running processes (proc.num) differs from the expected number of running process (created macro {$PROCESS1_EXPECTED}) . The expression of the trigger is “{PROCESS1 template: proc.num[java,,,{$PROCESS1}].last(#1)}<>{$PROCESS1_EXPECTED}”.
      The trigger is binded to an action that is sending some data to our server that in response queries the zabbix server to get the trigger info (http://serverIP/zabbix/api_jsonrpc.php with method trigger.get).
      The server receives a trigger object and parses it. I assumed that the field value is the result of the triggers expression (according to https://www.zabbix.com/documentation...trigger/object), but it seems that it is not like that.

      So my question is, how the value of the field, “value” of the trigger object is determined?

      Here is an example of the returned trigger object:
      {
      triggerid: "16050",
      expression: "{newPC: proc.num[java,,,myApp.jar].last(#1)}<>1",
      description: "myApp.jar state changed on newPC",
      url: "",
      status: "0",
      value: "0",
      priority: "0",
      lastchange: "0",
      comments: "",
      error: "",
      templateid: "15641",
      type: "0",
      state: "0",
      flags: "0",
      recovery_mode: "0",
      recovery_expression: "",
      correlation_mode: "0",
      correlation_tag: "",
      manual_close: "0",
      items: [itemid: "29134", type: "0", snmp_community: "", snmp_oid: "", hostid: "10269", name: "Is {$PROCESS1} running", key_: "proc.num[java,,,{$PROCESS1}]", delay: "30", history: "7d", trends: "365d", status: "0", value_type: "3", trapper_hosts: "", units: "", snmpv3_securityname: "", snmpv3_securitylevel: "0", snmpv3_authpassphrase: "", snmpv3_privpassphrase: "", formula: "", error: "", lastlogsize: "0", logtimefmt: "", templateid: "28253", valuemapid: "0", params: "", ipmi_sensor: "", authtype: "0", username: "", password: "", publickey: "", privatekey: "", mtime: "0", flags: "0", interfaceid: "4", port: "", description: "", inventory_link: "0", lifetime: "30d", snmpv3_authprotocol: "0", snmpv3_privprotocol: "0", state: "0", snmpv3_contextname: "", evaltype: "0", jmx_endpoint: "", master_itemid: "0", lastclock: "0", lastns: "0", lastvalue: "0", prevvalue: "0"
      }
      ]
      }
      Last edited by mishta; 24-12-2019, 11:02. Reason: smileys were shown instead of text

      Comment

      • Atsushi
        Senior Member
        • Aug 2013
        • 2028

        #4
        In my environment, as described in the manual, 0 is returned if the trigger status is normal, and 1 is returned if the trigger status is failure.

        Comment

        • mishta
          Junior Member
          • Aug 2018
          • 6

          #5
          Thanks for the response Atsushi.
          I would like to know how it decides if it is normal or failure?
          I thought that it is according to the expression, but in the example i posted, the expression of the trigger is false because the last value is 0 and the expected number of processes is 1, but the value field is 0 - meaning normal. I would expect that it would be 1.
          If you understand why it is 0, can you please explain?

          Comment

          • 1berto
            Senior Member
            • Sep 2018
            • 182

            #6

            Where in the manual is said that 0 is normal and 1 is failure?
            In this example the value is also 0...

            Anyway... If you need to send some data in a action probably there is better ways to do this than modify the value of the trigger.

            Comment

          • Atsushi
            Senior Member
            • Aug 2013
            • 2028

            #7
            The Zabbix server determines whether the status of the trigger is normal or failure based on the expression set in the trigger. Is the trigger you are trying to check displayed as a fault on the web front end? If it is not displayed, double check the trigger expression and the value of the item used in the expression.

            Comment

            • mishta
              Junior Member
              • Aug 2018
              • 6

              #8
              Thank you both for your responses. I understood that the trigger value is determined by the expression and in addition that it will be fired once on state change (because the trigger set to
              PROBLEM event generation mode - single) according to the last and prev values.

              Comment

              Working...