PDA

View Full Version : Summary Email


satchelp
17-07-2008, 23:01
Hi,

Is there anyway to setup a summary email that sends something like, "Triggers X, Y and Z have been on for the past hour." Or maybe even, "There are multiple true triggers." I'm running 1.4 and know there is no escalation, but I don't like the idea that if I miss a few emails I could have several alerts that I am unaware of.


Thanks,

Satchel

nelsonab
17-07-2008, 23:56
You'll have to write your own script that queries the database and then sends the email. I think there was a post I replied to a while ago with some SQL code to tell you what triggers were active and so forth.

Here is an SQL query which will show you what triggers are active. You'll need to add a join if you want to also show if something is acknowledged.


select distinct t.triggerid, t.description, t.lastchange, h.host, e.acknowledged
from triggers t, hosts h, items i, functions f, events e
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.value=1
and t.lastchange!=0
and e.objectid=t.triggerid
order by lastchange;

The query was essentially yanked from the PHP code. :-)

satchelp
18-07-2008, 17:41
Thanks for the reply. I'll give that a shot. :)


-Satchel

satchelp
02-08-2008, 09:02
Could you show the sql query with the join included to ignore acknowledged alerts? I can't seem to get just a list of active but unacknowledged alerts.

Thanks!

-Satchel