How to get host where problem appears Zabbix-api

I'm trying to make a script on Python, which works with zabbix-api.

For example: Trigger worked, problem appears and then I make an "action trigger", which will work on that host, where problem appeared. For the script, I need to get host (and host id), where problem appeared and then resolve the problem. But I don't know how to get only this host. Please, could you help me with this or maybe give me some advice, what am I doing wrong?

I tried something like:

my_host = zabbix_log.host.get(limit=1, output=["hostid", "name", "host"])[0]

Of course, it works, but I understand, that this is only give to me some random host, and not the host where problem appeared



Comments

Popular posts from this blog

Spring Elasticsearch Operations

Object oriented programming concepts (OOPs)

Spring Boot and Vaadin : Filtering rows in Vaadin Grid