Regarding Eventhandlers suppression in planned downtime

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
sami21
Posts: 9
Joined: Thu Aug 27, 2015 2:09 am

Regarding Eventhandlers suppression in planned downtime

Post by sami21 »

Hi,

As in planned downtime we can suppress the nagios notifications, can we do same with event handlers?
I mean would event handlers be executed in planned downtime?
And if we don't want event handler's to be called in planned down time what could be done?

Thanks in Advance.
****samya****
bwallace
Posts: 1146
Joined: Tue Nov 17, 2015 1:57 pm

Re: Regarding Eventhandlers suppression in planned downtime

Post by bwallace »

Good question. By default, most people do not write their event handlers with the capability to consider scheduled downtime. You can write logic into your event handler scripts so they will not run if downtime is detected. This is accomplished by using the $HOSTDOWNTIME$ and/or $SERVICEDOWNTIME$ macros in your event handler definitions. If these macros are non-zero, then the service/host is considered to be in scheduled downtime. This will allow you to have your event handlers decide how to proceed.

Two other options:
Disable all event handlers globally in nagios.cfg = enable_event_handlers
Disable event handler at the host or service level, check for 'event_handler = enabled' in the definition.

Hope this helps, but let us know if there are lingering questions.
Be sure to check out the Knowledgebase for helpful articles and solutions!
sami21
Posts: 9
Joined: Thu Aug 27, 2015 2:09 am

Re: Regarding Eventhandlers suppression in planned downtime

Post by sami21 »

Hi,
Thanks for reply.
Will try this suggestion.
****samya****
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Regarding Eventhandlers suppression in planned downtime

Post by mcapra »

Let us know if you encounter additional issues!
Former Nagios employee
https://www.mcapra.com/
Locked