Ad Widget

Collapse

Zabbix 5.0.2 API - Getting Triggers By TemplateIDs

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gdharris
    Junior Member
    • Jul 2020
    • 6

    #1

    Zabbix 5.0.2 API - Getting Triggers By TemplateIDs

    I am working with Zabbix 5.0.2, and I'm getting some odd behavior from the API. I'm trying to retrieve a list of all of the triggers for a specific template ID. Here is the payload that I am sending to the Zabbix API:

    Code:
    {
         "jsonrpc": "2.0",
         "method": "trigger.get",
         "params": {
              "templateids": [ "10330" ]
         },
         "id": 1,
         "auth": "<my auth ID>"
    }
    I'm not getting information back for a list of triggers for template ID 10330. Instead, I'm getting a list of triggers for template ID 0. Here is an example of the data that is returned:

    Code:
    {
         "jsonrpc": "2.0",
         "result": [
              {
                   "triggerid": "17032",
                   "expression": "{19974}<>0",
                   "description": "Cisco CCBU Support Tools NodeAgent Service Not Running",
                   "url": "",
                   "status": "1",
                   "value": "0",
                   "priority": "3",
                   "lastchange": "0",
                   "comments": "",
                   "error": "",
                   "templateid": "0",
                   "type": "0",
                   "state": "0",
                   "flags": "0",
                   "recovery_mode": "0",
                   "recovery_expression": "",
                   "correlation_mode": "0",
                   "correlation_tag": "",
                   "manual_close": "0",
                   "opdata": "",
                   "discover": "0"
              }
         ]
         id: "1"
    }
    Any assistance in this matter would be greatly appreciated!
Working...