Hi, I want to have all the events of triggers that happent in de past for all host. I thought of this sql but it doesn’t have any row, so it’s wrong.
SELECT
events.`clock` AS events_clock,
events.`value` AS events_value,
hosts.`host` AS hosts_host,
hosts.`ip` AS hosts_ip,
items.`description` AS items_description
FROM
`events` events INNER JOIN `escalations` escalations ON events.`eventid` = escalations.`eventid`
INNER JOIN `triggers` triggers ON escalations.`triggerid` = triggers.`triggerid`
INNER JOIN `functions` functions ON triggers.`triggerid` = functions.`triggerid`
INNER JOIN `items` items ON functions.`itemid` = items.`itemid`
INNER JOIN `hosts` hosts ON items.`hostid` = hosts.`hostid`
I think I made the mistake of inner joining the trigger table (I think its static)
Can anybody help me on may way
SELECT
events.`clock` AS events_clock,
events.`value` AS events_value,
hosts.`host` AS hosts_host,
hosts.`ip` AS hosts_ip,
items.`description` AS items_description
FROM
`events` events INNER JOIN `escalations` escalations ON events.`eventid` = escalations.`eventid`
INNER JOIN `triggers` triggers ON escalations.`triggerid` = triggers.`triggerid`
INNER JOIN `functions` functions ON triggers.`triggerid` = functions.`triggerid`
INNER JOIN `items` items ON functions.`itemid` = items.`itemid`
INNER JOIN `hosts` hosts ON items.`hostid` = hosts.`hostid`
I think I made the mistake of inner joining the trigger table (I think its static)
Can anybody help me on may way
Comment