Ad Widget

Collapse

Triggers set to OK after Acknowledgelment by user

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • simonquentel
    Member
    • Mar 2013
    • 49

    #1

    Triggers set to OK after Acknowledgelment by user

    Hi everyone,

    I would like to have your opinion about the following work around for updating trigger status to OK after a manual acknowledgement in Zabbix GUI:

    What I do is to automatically run a script every two minutes (cron table of Zabbix Server, where the DB is installed too), that update field "value" of table triggers:

    update triggers set value=0,error=''
    where triggerid in (
    select ee.objectid from events ee
    inner join
    (select objectid,MAX(eventid) as maxid
    from events
    group by objectid)
    ee2 on ee.objectid=ee2.objectid and ee.eventid=ee2.maxid
    where
    ee.acknowledged=1)
    and value=1

    I could add control by chosing the "items type" for which I want the item to be updated (for instance, apply the change only for triggers linked to items of type 'SNMP trap')

    What do you think of it?

    Any better Idea?

    regards,

    Simon
  • simonquentel
    Member
    • Mar 2013
    • 49

    #2
    If you want to make the action only for a given type of items (such as SNMP traps), you can reuse the field 'type' of items table:

    update triggers set value=0,error=''
    where triggerid in (
    select ee.objectid from events ee
    inner join
    (select objectid,MAX(eventid) as maxid
    from events
    group by objectid)
    ee2 on ee.objectid=ee2.objectid and ee.eventid=ee2.maxid
    where
    ee.acknowledged=1 )
    and triggerid in (
    select triggerid from functions f
    inner join items i on i.itemid=f.itemid
    where i.type=17)
    and value=1

    Simon

    Comment

    Working...