Disable Reactor event handler during downtime

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Disable Reactor event handler during downtime

Post 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
You do not have the required permissions to view the files attached to this post.
Nagios XI 5.8.1
https://outsideit.net
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Disable Reactor event handler during downtime

Post 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.
Former Nagios employee
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Disable Reactor event handler during downtime

Post 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
Nagios XI 5.8.1
https://outsideit.net
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Disable Reactor event handler during downtime

Post by lmiltchev »

Thanks, Willem! I am closing the thread.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked