[ZBX-25099] Using python Zabbix_Utils, the triggers.get API call always returns all triggers regardless of the host and hostids parameters. Created: 2024 Aug 22 Updated: 2024 Aug 22 Resolved: 2024 Aug 22 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | API (A) |
Affects Version/s: | 7.0.3 |
Fix Version/s: | None |
Type: | Incident report | Priority: | Major |
Reporter: | Juan Carlos Angelucci | Assignee: | Zabbix Support Team |
Resolution: | Fixed | Votes: | 0 |
Labels: | api, trigger.get | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Attachments: |
![]() |
Description |
When making the triggers.get API call and passing a host or hostids as parameters, it returns all triggers configured in Zabbix instead of filtering those that belong to the specified host. When testing the same method through Postman, it works correctly and only returns the triggers for the host provided as a parameter. Attached are scripts to reproduce the error. zabbix_url = "xxxxxxxxxxxxxx" ) Python Using host zabbix_url = "xxxxxxxxxxxxxx" hosts = zapi.host.get({"filter": {"host": hostname}}) ) Postman: , This was tested with Zabbix 7. |
Comments |
Comment by Alexey Pustovalov [ 2024 Aug 22 ] |
You use API methods incorrectly: triggers = zapi.trigger.get( host = 'Zabbix server', output = ["extend"] ) Please check official documentation: https://github.com/zabbix/python-zabbix-utils |
Comment by Juan Carlos Angelucci [ 2024 Aug 22 ] |
Same Result using
|
Comment by Juan Carlos Angelucci [ 2024 Aug 22 ] |
zabbix_url = "xxxxxxxxxxxxxxxx" ) ") |
Comment by Alexey Pustovalov [ 2024 Aug 22 ] |
Please check official documentation: https://github.com/zabbix/python-zabbix-utils! |
Comment by Juan Carlos Angelucci [ 2024 Aug 22 ] |
"Thank you for responding. However, isn't this something that should be resolved by the Python library if the request is malformed? Due to the lack of [], it returns all the triggers." |
Comment by Alexey Pustovalov [ 2024 Aug 22 ] |
It is not malformed, you just do not specify any parameters. By default, it means all data. |