Event Handlers in Scheduled Downtime
-
- Posts: 17
- Joined: Fri Dec 21, 2018 11:18 am
Event Handlers in Scheduled Downtime
I have checks with Event Handlers used to restart failed windows services. We will be upgrading those services this weekend and I need the event handlers to not fire when they detect an outage. Does placing a service check in Scheduled Downtime disable event handlers or do I need to deactivate the service check configs or is there another recommended method for disabling these?
Re: Event Handlers in Scheduled Downtime
Hi @NeoMatrixJR,
It looks to me like downtimes only block notifications, not event handlers. I think you'll want to directly disable event handlers for each of the hosts/services you're upgrading.
If you need Nagios Core to stay running the whole time, I would probably use external commands - here is the documentation to disable an event handler for a specific host.
If it's easier for you to change the configuration and restart Core instead, you can just set the event_handlers_enabled directive for each host or service that needs them disabled. If you're using the CCM that's in [Host/Service] -> Edit -> Check Settings. If you're using the bulk modifications tool, it should show up in "Change single config option", towards the bottom of the dropdown.
Hopefully that helps - please let me know if you have any further questions or concerns.
It looks to me like downtimes only block notifications, not event handlers. I think you'll want to directly disable event handlers for each of the hosts/services you're upgrading.
If you need Nagios Core to stay running the whole time, I would probably use external commands - here is the documentation to disable an event handler for a specific host.
If it's easier for you to change the configuration and restart Core instead, you can just set the event_handlers_enabled directive for each host or service that needs them disabled. If you're using the CCM that's in [Host/Service] -> Edit -> Check Settings. If you're using the bulk modifications tool, it should show up in "Change single config option", towards the bottom of the dropdown.
Hopefully that helps - please let me know if you have any further questions or concerns.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy
-
- Posts: 17
- Joined: Fri Dec 21, 2018 11:18 am
Re: Event Handlers in Scheduled Downtime
This will be on an instance of Nagios XI. I'm going to be instructing application admins on how to go in and make changes. I'll be driving them through the change this afternoon. It sounds like the easiest path for them would be to disable the service check altogether in the GUI for the duration and then re-enable when done.
Re: Event Handlers in Scheduled Downtime
That is useful context! I agree, if you have a team that you can delegate to, so that everyone is only updating a few hosts, then disabling and re-enabling the service checks individually should be fine. The two approaches I gave in the third paragraph could still work, but that's more useful if you're doing bulk management of your hosts and/or trying to get the job done as an individual.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy
-
- Posts: 17
- Joined: Fri Dec 21, 2018 11:18 am
Re: Event Handlers in Scheduled Downtime
Not sure how to make this a feature request, but I'd suggest that if a service is in scheduled downtime, event handlers for that service shouldn't fire.
Re: Event Handlers in Scheduled Downtime
I agree that this seems reasonable to add! I've added an issue for this on Github.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy
Re: Event Handlers in Scheduled Downtime
Which file would that be?swolf wrote: ↑Tue Mar 19, 2024 10:39 am I agree that this seems reasonable to add! I've added an issue for this on Githubsnow rider 3d
Re: Event Handlers in Scheduled Downtime
This is not a good idea...
This change would then stop all "on-state-change" event handlers from being executed during a downtime window.
The handler should be executed when any host or object changes state i.e. global event handlers.
You account for this possibility by adding a step to check for a downtime depth greater than 0 to your event handler which is meant to operate outside notifications.
$SERVICEDOWNTIME$
$HOSTDOWNTIME$
Are the nagios macros that you'll want to pass as variables to evaluate in your handler.
This change would then stop all "on-state-change" event handlers from being executed during a downtime window.
The handler should be executed when any host or object changes state i.e. global event handlers.
You account for this possibility by adding a step to check for a downtime depth greater than 0 to your event handler which is meant to operate outside notifications.
$SERVICEDOWNTIME$
$HOSTDOWNTIME$
Are the nagios macros that you'll want to pass as variables to evaluate in your handler.