Ad Widget

Collapse

API - trigger.get method - not returning desired result

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • billhubb
    Junior Member
    • Apr 2015
    • 1

    #1

    API - trigger.get method - not returning desired result

    Good day,

    I am trying to use the API to return results for a daily report that we will use for agent availability. We have a trigger setup that performs a check on the agent and should be in a problem state if not available.
    For reference the trigger is looking at:

    ({Agent and Host Availability Template:zabbix[host,agent,available].last(0)}#1 | {Agent and Host Availability Template:zabbix[host,agent,available].nodata(600)}=1)

    The exact name of the trigger is: Zabbix agent on {HOSTNAME} is Unreachable

    I have the following json query written to try and pull down all triggers that are in a bad state, but whether I set the value to 0 or 1 I get no results, even though I know that the triggers are in an Ok state presently.

    Code:
    {
        "jsonrpc": "2.0",
        "method": "trigger.get",
        "params": {
            "output": [
                "triggerid",
                "description",
                "priority"
            ],
          "search": {
            "description": "Zabbix agent on"
          },
            "filter": {
                "value": 1
            },
            "sortfield": "priority",
            "sortorder": "DESC",
          "expandData": 1,
          "expandDescription": 1
        },
       "id": 15,
       "auth": "MASKEDFORSECURITY"
    }
    If I substitute the value for 0 above, I get no results as well. If I subsitute the description text above for any other trigger name I get results. Can anyone think of a reason why certain triggers could be being excluded? I'm really at a loss.

    Thanks in advance.
Working...