Ad Widget

Collapse

Select events from database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • waardd
    Member
    • Aug 2014
    • 82

    #1

    Select events from database

    I have a select statement in 1.8 of zabbix wich collects events and it looks like this

    Code:
    SELECT DISTINCT host, t.description, f.triggerid, e.acknowledged, t.value, i.lastvalue, priority, maintenance_status, FROM_UNIXTIME(t.lastchange)
    FROM triggers t
    INNER JOIN functions f ON ( f.triggerid = t.triggerid )
    INNER JOIN items i ON ( i.itemid = f.itemid )
    INNER JOIN hosts ON ( i.hostid = hosts.hostid )
    INNER JOIN events e ON ( e.objectid = t.triggerid )
    WHERE (e.eventid DIV 100000000000000)
    IN (0)
    AND (e.object-0)=0
    AND (t.value=1 OR (t.value =0 AND unix_timestamp(now()) - t.lastchange <60))
    AND hosts.status =0
    AND i.status =0
    AND t.status =0
    AND maintenance_status = 1
    GROUP BY f.triggerid
    ORDER BY t.lastchange DESC;
    I now want it to use in version 2.4 of zabbix but it does not work.
    Can someone point me in the right direction?

    Error i get is:
    Error Code: 1054. Unknown column 'i.lastvalue' in 'field list'
Working...