Page 1 of 1

How to clear alarms using alertid

Posted: Mon Sep 18, 2023 3:19 am
by Anto
Hi Team

From a database monitoring tool I'm receiving traps for various metrics when they exceed the thresholds.
For example I receiving traps named "Total activity time" when one sql statements exceed the thesholds like this:

New WARNING Alert 5482: Total activity time on xyz : Warning threshold: 300 s Total activity wait time: 44 s Rows returned: 0 Total activity time: 347 s Total CPU time: 1778 ms Rows read: 270429 User: xyz Application name: xyz Client hostname: .... Application handle: ...

and a clear traps when the statement is completed:

Closed WARNING Alert 5470: Total activity time on xyz:

I send these type of alarm to a nagios service called "Total activity time" and my question is about to selectively clear just the alarms with the same alertid that in the example is "Alert 5482".
Does anyone know if this can be done?

Re: How to clear alarms using alertid

Posted: Mon Sep 18, 2023 9:36 am
by sgardil
Hey @Anto

From the sounds of it if you have this data sent to a service, you should be able to create an event handler to do exactly what you want. I'll link some documentation on event handlers with nagios. If you want you can search for event handlers made by the community on our exchange site to see if anything matches. If you find one you'll still need to change some of the code to do exactly what you want but it could give a baseline. Hope this helps.

https://assets.nagios.com/downloads/nag ... ios-XI.pdf
https://assets.nagios.com/downloads/nag ... dlers.html
https://exchange.nagios.org/directory/A ... t-Handlers

Re: How to clear alarms using alertid

Posted: Tue Sep 19, 2023 12:44 pm
by Anto
Hi @sgardil

Thanks a lot for your suggestion !