Page 1 of 1

Nagios XI event Handler question

Posted: Tue Dec 11, 2018 3:06 pm
by JakeHatMacys
We had a situation where we sent an event and the status didn't change for 74 days on the service. Turns out the event originally may have been dropped due to a downtime on the device.

Is there a clear setting in the config to resend event handlers say every 7 days if the status has stayed in error or warning???

I know we've scripted cases like this but wanted to see if there was a way to set this up internally. And generally we want to retain status information...

Re: Nagios XI event Handler question

Posted: Tue Dec 11, 2018 4:45 pm
by npolovenko
Hello, @JakeHatMacys. Event handlers fire off only on service status changes. There is no recurring option for event handlers. And event handlers should still be active during the scheduled downtime. In the scenario you described scripting seems to be the only option.

PS: Actually if you turn on the "Is Volatile" option under Check Settings, XI will treat each service recheck (in a hard non-OK state) as a state change and the event handler will fire each time.
https://assets.nagios.com/downloads/nag ... vices.html
You'll still need to come up with a custom logic in the script that will resend notifications with a certain interval.

Re: Nagios XI event Handler question

Posted: Wed Dec 12, 2018 9:30 am
by JakeHatMacys
npolovenko wrote:Hello, @JakeHatMacys. Event handlers fire off only on service status changes. There is no recurring option for event handlers. And event handlers should still be active during the scheduled downtime. In the scenario you described scripting seems to be the only option.

PS: Actually if you turn on the "Is Volatile" option under Check Settings, XI will treat each service recheck (in a hard non-OK state) as a state change and the event handler will fire each time.
https://assets.nagios.com/downloads/nag ... vices.html
You'll still need to come up with a custom logic in the script that will resend notifications with a certain interval.
Is there a custom command to restart Nagios and not retain status on Services? I was thinking if I could cron up that custom restart specifically every 7 days it would fit my needs.

Re: Nagios XI event Handler question

Posted: Wed Dec 12, 2018 3:00 pm
by npolovenko
@JakeHatMacys, You can create a script that will stop the nagios service, delete the retention.dat file and then start the nagios process back up.
service nagios stop
rm /usr/local/nagios/var/retention.dat
service nagios start
Run this script every 8 days.

*Retention.dat file contains scheduled downtime entries, host and service acknowledgments, host and service check states. So all of that will be gone. But that's what you want, right?

Re: Nagios XI event Handler question

Posted: Wed Dec 12, 2018 4:10 pm
by JakeHatMacys
npolovenko wrote:@JakeHatMacys, You can create a script that will stop the nagios service, delete the retention.dat file and then start the nagios process back up.
service nagios stop
rm /usr/local/nagios/var/retention.dat
service nagios start
Run this script every 8 days.

*Retention.dat file contains scheduled downtime entries, host and service acknowledgments, host and service check states. So all of that will be gone. But that's what you want, right?
Sounds like it will do the trick. Just need to make sure nothing is affected like Services that have been disabled in Core etc. I'll give it a whirl thanks!

Re: Nagios XI event Handler question

Posted: Wed Dec 12, 2018 5:00 pm
by npolovenko
@JakeHatMacys, Deactivated services in CCM will stay deactivated. Sounds good.