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

Zabbix API: Filtering trigger.get by host don't work

    XMLWordPrintable

    Details

    • Type: Incident report
    • Status: Closed
    • Priority: Critical
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: API (A)
    • Labels:
      None
    • Environment:
      Tested with Zabbix 2.2.2, 2.2.5, 2.2.9

      Description

      Hi,
      According to the Zabbix API documentation (https://www.zabbix.com/documentation/2.0/manual/appendix/api/trigger/get), I can filter triggers by host using the attribute "host". But this does not work in many Zabbix 2.2.x versions (Tested with Zabbix 2.2.2, 2.2.5 and 2.2.9).

      Indeed, assuming that the "auth" given in the following json is valid, making the following curl request returns empty result ({"jsonrpc":"2.0","result":[],"id":3}). And that's not compliant with the aforementioned API specification.

      In the example "zabbix-server-addr" point to a valid Zabbix server

      curl -X POST -H 'Content-Type: application/json' -d '{
        "jsonrpc": "2.0",
        "auth": "4046f8c10bb1050e19ed6f4e73ad1474",
        "method": "trigger.get",
        "params": {
          "active": true,
          "host": "Zabbix server",
          "selectGroups": [
            "name"
          ],
          "selectHosts": [
            "host"
          ],
          "selectItems": [
            "key_",
            "name",
            "lastclock"
          ],
          "output": [
            "description",
            "value",
            "error",
            "comments",
            "priority"
          ],
          "limit": -1
        },
        "id": 3
      }' 'http://zabbix-server-addr/zabbix/api_jsonrpc.php'
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              jeriot James Eriot
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: