Page 1 of 1

Disable Reactor event handler during downtime

Posted: Tue Jan 19, 2016 7:28 am
by WillemDH
Hello,

So I made a Reactor event chain that is able to manipulate Windows services. it is able to start, stop, restart one or more service on a host or all members of a hostgroup. I added some code which helps to determine if this event chain is launched with a Nagios event handler. So it accepts the curentservice state and the statetype and will compare this with the requested state type and service state to see if the service is to be started / stopped / restarted.
This works fine, but i'm having the folllowing thought:

As this event chain is triggered every time the state of the service is hard critical, this means we are no longer able to stop the service for longer then 5 minutes. Is there a way to make Nagios XI not execute event handlers when the service / host is in downtime?
I could script this manually and check in the code if the service is in downtime, but it seems logical this should be a global option to not execute event handlers while in downtime?

Grtz

Willem

Re: Disable Reactor event handler during downtime

Posted: Tue Jan 19, 2016 5:22 pm
by tmcdonald
WillemDH wrote:I could script this manually and check in the code if the service is in downtime
That's the solution for right now.
WillemDH wrote:but it seems logical this should be a global option to not execute event handlers while in downtime?
I can see the argument for that, but event handlers are meant to handle events, and we let the script decide how. Just like how plugins handle their own checking logic, notifications handle their own logic, etc. Now granted, plugins and notifications have logic in Core itself to determine when they are run, but they are also assumed to be used in all installs, whereas event handlers are somewhat optional. This keeps configuration clutter down.

Definitely could make a feature request for this on GitHub, likely wouldn't be too hard (I've added similar things myself in the past). I just can't make any guaranteees.

Re: Disable Reactor event handler during downtime

Posted: Wed Jan 20, 2016 2:18 am
by WillemDH
Trevor,

Ok, thanks. Good to know it isn't possible yet.

I made https://github.com/NagiosEnterprises/na ... issues/108

This thread can be closed.

Grtz

Willem

Re: Disable Reactor event handler during downtime

Posted: Wed Jan 20, 2016 10:48 am
by lmiltchev
Thanks, Willem! I am closing the thread.