Full task:
Via API disable/enable trigger which belongs to some host. Only part of host name is known, i.e. zabbix has host name like 'prod-role-prio-i-aabbccdd", but external script know only instance id, 'i-aabbccdd'.
Easy way: find host ID using host name via 'search' in host.get and then use that ID in trigger.get.
But maybe there is a way to do this in one query?
I've tried something like this:
But it shows all hosts those have that trigger. How to show trigger which belongs only to host "*i-aabbccdd"?
I can't use 'host' parameter in trigger.get because it requires full host name, but only part of host name is know (by external script).
Via API disable/enable trigger which belongs to some host. Only part of host name is known, i.e. zabbix has host name like 'prod-role-prio-i-aabbccdd", but external script know only instance id, 'i-aabbccdd'.
Easy way: find host ID using host name via 'search' in host.get and then use that ID in trigger.get.
But maybe there is a way to do this in one query?
I've tried something like this:
Code:
{
"output": "triggerids",
"selectHosts": {
"search": {
"name": "i-aabbccdd"
}
},
"search": {
"description": "Supervisord STOPPED State of worker application on host"
}
}
I can't use 'host' parameter in trigger.get because it requires full host name, but only part of host name is know (by external script).