Ad Widget

Collapse

Working out which triggers have been triggered (SQL query)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nickfarrell
    Junior Member
    • May 2008
    • 4

    #1

    Working out which triggers have been triggered (SQL query)

    Hi,

    I'm looking to integrate Zabbix with our existing trouble ticketing system, and I'm wondering if there is already a mysql query out there which gives a list of current triggers fired? This way we can monitor them from our other system, and open tickets if necessary?

    Has anyone done this before, save me re-working the wheel!?

    Thanks in advance!

    Nick Farrell
    Rock IT Group
  • m2is
    Junior Member
    • Oct 2007
    • 2

    #2
    mysql query

    try this :

    mysql> select * from triggers where status=TRUE;

    grtz,
    Marco

    Comment

    • nickfarrell
      Junior Member
      • May 2008
      • 4

      #3
      sql query

      Thanks Marco

      I had worked that bit out, but couldn't see how all the tables related to each other. In the end, I have used this query, which gives me what I need, and also how long those triggers have been going off for, so I can delay by a couple of minutes and avoid false positives...

      SELECT triggers.triggerid, hosts.host, triggers.description, lastchange, comments AS ticketid, UNIX_TIMESTAMP(Now()) - lastchange AS elapsed FROM triggers JOIN functions ON
      SUBSTRING(expression,2,5) = functions.functionid JOIN items ON functions.itemid = items.itemid JOIN hosts ON items.hostid = hosts.hostid WHERE value=1 AND lastchange > 0

      Thank you for your help though - much appreciated.

      Comment

      Working...