Ad Widget

Collapse

Daily email report of active triggers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bbrendon
    Senior Member
    • Sep 2005
    • 870

    #1

    Daily email report of active triggers

    Some of the things we monitor, we don't care to get an email, but a daily report of active triggers.

    If someone can help with the SQL statement, I can do it. I haven't yet figured out how to ask the database for active triggers. There must be two tables I need to join.

    Can someone assist?
    Unofficial Zabbix Expert
    Blog, Corporate Site
  • bbrendon
    Senior Member
    • Sep 2005
    • 870

    #2
    Hmm. This is close, but not quite.

    select h.host,t.description from hosts h,items i, functions f, triggers t where h.status=0 and h.hostid=i.hostid and i.itemid=f.itemid and t.triggerid=f.triggerid and t.status=0;
    Unofficial Zabbix Expert
    Blog, Corporate Site

    Comment

    • bbrendon
      Senior Member
      • Sep 2005
      • 870

      #3
      okay.

      Can someone tell me how to make this query only show un-acknowledged triggers?

      Code:
      SELECT DISTINCT
      h.host,
      t.triggerid,
      t.`status`,
      t.description,
      t.priority,
      t.lastchange,
      t.comments,
      t.value
      FROM
      triggers AS t ,
      `hosts` AS h ,
      items AS i ,
      functions AS f ,
      acknowledges
      Inner Join events ON events.eventid = acknowledges.eventid
      WHERE f.itemid=i.itemid AND h.hostid=i.hostid  AND t.triggerid=f.triggerid AND t.status=0 AND i.status=0 AND  (t.triggerid div 100000000000000) in (0)  AND h.hostid not in (-1)  AND h.status=0  AND ((t.value=1))  AND t.value<>2
      order by t.priority desc, t.description
      Unofficial Zabbix Expert
      Blog, Corporate Site

      Comment

      Working...