Ad Widget

Collapse

Report error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stage
    Member
    • Sep 2009
    • 34

    #1

    Report error

    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
  • igor
    ZABBIX Support Specialist
    • Mar 2009
    • 40

    #2
    Hi!
    Such SQL query can look like this:

    select e.clock, e.value, h.host, h.ip, i.description
    from hosts h, triggers t, items i, functions f, events e
    where t.triggerid = f.triggerid and f.itemid = i.itemid and i.hostid = h.hostid and e.objectid=t.triggerid and e.object=0 and h.status=0 and t.status=0

    Comment

    Working...