Ad Widget

Collapse

SQL: uptime

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mrogers-9898
    Member
    • Sep 2008
    • 68

    #1

    SQL: uptime

    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?
Working...