[ZBX-9876] Zabbix API: Filtering trigger.get by host don't work Created: 2015 Sep 15  Updated: 2017 May 30  Resolved: 2015 Sep 16

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A)
Affects Version/s: None
Fix Version/s: None

Type: Incident report Priority: Critical
Reporter: James Eriot Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Tested with Zabbix 2.2.2, 2.2.5, 2.2.9


Issue Links:
Duplicate
duplicates ZBX-6834 "Trigger.get" with "host" param retur... Closed

 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'


 Comments   
Comment by Oleksii Zagorskyi [ 2015 Sep 16 ]

Reproducible on 2.2 only (r55377), the shortest JSON is:

{
    "jsonrpc": "2.0",
    "method": "trigger.get",
    "params": {
        "host": "Zabbix server"
    },
    "id": 0,
    "auth": "877be4227a4a869a466fe77ae5ca7426"
}

Not reproducible on 2.4 (r55379).

Comment by Oleksii Zagorskyi [ 2015 Sep 16 ]

Fixed already in ZBX-6834.
Closing as duplicate.

Generated at Sat Aug 02 09:51:14 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.