Page 1 of 2

I need downtime to include turning off the event handler

Posted: Thu Jan 16, 2020 3:23 pm
by bpennin
All,

We need to have a way to put a service in downtime and prevent the event handler from running for that service during that downtime period. Scheduled downtime just prevents notifications but allows the event handler to run, which in our case, sends a notification of the service being down to TrueSight(BMC event handler and notification software). Is there a way to stop a service from running or disabling the event handler outside of scheduled downtime?

Thanks for your help!

Re: I need downtime to include turning off the event handler

Posted: Thu Jan 16, 2020 3:32 pm
by scottwilkerson
You can pass the following macro to your event handler command and if its value is not 0 exit

Code: Select all

$SERVICEDOWNTIME$
https://assets.nagios.com/downloads/nag ... cedowntime

Re: I need downtime to include turning off the event handler

Posted: Thu Jan 16, 2020 4:03 pm
by bpennin
Scott - Thanks for the quick response and we will run this through our test environment and let you know if we have questions. I am assuming we will not but I will reply back so you can lock this up.

Re: I need downtime to include turning off the event handler

Posted: Thu Jan 16, 2020 4:23 pm
by scottwilkerson
bpennin wrote:Scott - Thanks for the quick response and we will run this through our test environment and let you know if we have questions. I am assuming we will not but I will reply back so you can lock this up.
sounds good

Re: I need downtime to include turning off the event handler

Posted: Fri Jan 17, 2020 3:35 pm
by bpennin
I found that I can turn off the global event handler during downtime. Cool - but not that cool...
When down time is ended and I have a host down still the event handler does not pick it up? What can we do to alert on hosts that are still down after a black out period?

Re: I need downtime to include turning off the event handler

Posted: Mon Jan 20, 2020 7:19 am
by scottwilkerson
How did you setup the event handlers with the macro I provided?

Re: I need downtime to include turning off the event handler

Posted: Mon Jan 20, 2020 1:10 pm
by bpennin
Scott,

I pass the hostindowntime to our eventhandler but we are not using it because the global event handler has don't run in downtime checked. Unless I am missing something, I can not find a way to make the event handler run again after downtime ends to see a host that is still down? I did find the is volatile setting but that is only for a service and would be very chatty to deal with.

Re: I need downtime to include turning off the event handler

Posted: Mon Jan 20, 2020 1:23 pm
by scottwilkerson
Oh, I didn't see that it was a global event handler..

Yes these only fire when the state changes.

Re: I need downtime to include turning off the event handler

Posted: Mon Jan 20, 2020 1:35 pm
by bpennin
Forum folks/Scott

- Does anyone have a event handler that will see a host/service down during downtime that will run again when downtime is over to see if the host/service is still in a down state?

Re: I need downtime to include turning off the event handler

Posted: Mon Jan 20, 2020 1:41 pm
by scottwilkerson
I'll leave this open in case someone else has a solution, but, Nagios only fires event handlers when state changes, so an event handler will not fire if the state doesn't change after it comes out of downtime.