Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-23133

API call trigger.get can also return object of objects

XMLWordPrintable

      The below API call will return an object of objects, however the documentation only states the following:

      (integer/array) Returns either:

      • an array of objects;
      • the count of retrieved objects, if the countOutput parameter has been used.

       

      {"jsonrpc":"2.0","method": "trigger.get",
          "params": {
              "selectHosts":       ["name"],
              "selectGroups":      ["groupid", "name"],
              "selectLastEvent":   "extend",
              "selectFunctions":   "extend",
              "expandExpression":  "true",
              "expandData":        "true",
              "expandDescription": "true",
              "skipDependent":     "true",
              "preservekeys":      "true",
              "monitored": "true",
              "output": "extend",
              "filter": {
                  "value": 1
              },
              "sortfield": "priority",
              "sortorder": "DESC"
          },"id":1} 

      Returns

      {
        "jsonrpc": "2.0",
        "result": {
          "28110": {
            "triggerid": "28110",
            "expression": "min(/somehost/service.info[\"WinServiceBlah\",state],#3)<>0",
            "description": "\"WinServiceBlah\" (Blah bleh service) is not running",
            "url": "",
            "status": "0", 
      ... snip ...
        },
        "id": 1
      }

      I don't know if this is a documentation issue or if it's a bug and the code should never return an object of objects.

      Haven't tested any other .get method to see if they have the same issue.

      /Lasse

            zabbix.dev Zabbix Development Team
            lasseoe Lasse Osterild
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: