Hello!
I'd like to query the Zabbix SQL database directly and extract my monitored host's uptime.
I've got a handly little no-data trigger that I use as an indicator to monitor host availability.
I can quite readily get the triggerid in question from the database with
select i.itemid, f.triggerid, t.description
from items i
left join hosts h on i.hostid = h.hostid
left join functions f on i.itemid = f.itemid
left join triggers t on f.triggerid = t.triggerid
where h.hostid = A-Host-ID
and t.description = "NoDataTrigger"
and t.status = 0
and i.status = 0
but once I've got it, I cant figure out what/how to query for the history of that trigger (which i'm 100% positive is somewhere in the zabbix database).
any tips?
I'd like to query the Zabbix SQL database directly and extract my monitored host's uptime.
I've got a handly little no-data trigger that I use as an indicator to monitor host availability.
I can quite readily get the triggerid in question from the database with
select i.itemid, f.triggerid, t.description
from items i
left join hosts h on i.hostid = h.hostid
left join functions f on i.itemid = f.itemid
left join triggers t on f.triggerid = t.triggerid
where h.hostid = A-Host-ID
and t.description = "NoDataTrigger"
and t.status = 0
and i.status = 0
but once I've got it, I cant figure out what/how to query for the history of that trigger (which i'm 100% positive is somewhere in the zabbix database).
any tips?