Ad Widget

Collapse

API query for all current triggers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jfroot
    Junior Member
    • Mar 2013
    • 3

    #1

    API query for all current triggers

    Hi All,

    Running Zabbix 2.0.4

    I want to get a list of currently triggered items that matches the web interface when you would go to Monitoring -> Triggers

    After reading the documentation, the JSON below should work. However I consistently have a few triggers that are not showing up in the resulting JSON that do show up in web interface. Any ideas what could cause this?

    {
    "jsonrpc":"2.0",
    "id":0,
    "auth":"xxx",
    "method":"trigger.get",
    "params":{
    "output":"extend",
    "expandData":"1",
    "expandDescription":"1",
    "monitored":"true",
    "only_true":"true",
    "filter":{"value":1},
    "user":"guest",
    "password":"guest"
    }
    }
  • Pavels
    Member
    • Oct 2011
    • 83

    #2
    You may be missing some triggers because you use the "filter" parameter. In monitoring triggers we show triggers that are currently in problem state or have recently been in problem state. That's what the "only_true" parameter does. But filter "value": 1 returns only triggers that are currently in problem state, omitting the ones that have recently switched to OK. If you need the same triggers as in monitoring / triggers, just remove the filter.

    Also don't pass the "user" and "password" parameters. They are only required for authentication.

    Comment

    Working...