-
Incident report
-
Resolution: Fixed
-
Trivial
-
None
-
None
-
None
-
Zabbix 5.0.5 LTS (Centos 8)
Steps to reproduce:
- Pick any HOST; note HOST.ID
- Pick some ITEMS from this host; note ITEM.ID
- Setup a request to API while specifying specific HOSTIDS and ITEMIDS or
- Setup a request to API while specifying only ITEMIDS
Result:
Empty
Expected:
Graphs specific for the given ITEMIDS
Workaround applied
- Fetch all graphs for that HOSTID
- Filter on graphs that have graphitems referring to ITEMIDS
Not sure where this goed wrong, but it's definitely in CGraph.php under API services where, if specifying both HOSTIDS and ITEMIDS, may lead to a conflicting query statement:
// hostids
...
$sqlParts['where']['igi'] = 'i.itemid=gi.itemid';
...
// itemids
...
$sqlParts['where'][] = dbConditionInt('gi.itemid', $options['itemids']);
...
Just a gut feeling from my side - happy to dig deeper, but first wanted to pass here for verification from your end ...
----------
Some debug logging:
2021-03-02 09:19:37 : # Retrieve associated graphs to this item
2021-03-02 09:19:37 : % postJSON: https://<mydomain>/zabbix/api_jsonrpc.php
2021-03-02 09:19:37 : > POST data{"jsonrpc":"2.0","method":"graph.get","params":
,"auth":"620fb998c4538ff719d0f7c45d536eda","id":6}
2021-03-02 09:19:37 : > Received 36 bytes
2021-03-02 09:19:37 : > Graph data
I've verified the hostids and itemids. If I execute without itemids, the graphitems associated are included in the results ...