In order to automate the remediation of problems, I am trying to use the Zabbix API to gather a list of computers that are unreachable via Zabbix Agent ping.
So far I have created a tag on the "Zabbix agent on {HOST.NAME} is unreachable" trigger that is called "unpingable." Then I am using the problem.get method in the API to list all problems with the tag "unpingable". From here my problem has become, how do I coordinate the list of problems I get back, to a lists of hosts that are experiencing that problem? I was able to look up the specific trigger by using trigger.get to fetch a list of all triggers and comparing the "triggerid" field to the "objectid" field in the problem object. However, I cannot figure out from there how I might get a hostID or hostname (I can look up the host name if I could get the hostID).
Anyone have any suggestions for how to fetch the hostID from a problem object or other ways I might go about getting a list of unreachable machines?
Thanks!
So far I have created a tag on the "Zabbix agent on {HOST.NAME} is unreachable" trigger that is called "unpingable." Then I am using the problem.get method in the API to list all problems with the tag "unpingable". From here my problem has become, how do I coordinate the list of problems I get back, to a lists of hosts that are experiencing that problem? I was able to look up the specific trigger by using trigger.get to fetch a list of all triggers and comparing the "triggerid" field to the "objectid" field in the problem object. However, I cannot figure out from there how I might get a hostID or hostname (I can look up the host name if I could get the hostID).
Anyone have any suggestions for how to fetch the hostID from a problem object or other ways I might go about getting a list of unreachable machines?
Thanks!
Comment