Page 1 of 1

Event Handlers and distributed monitoring with gearman

Posted: Fri Aug 05, 2016 10:57 am
by drug
We use mod_gearman to distribute all of our checks to distributed nodes. We rely on the Global Event Handler component in order to execute a script that generates tickets within our ticketing system when faults occur.

We would like eventhandlers to execute on their respective distributed node. This works; however, when this is enabled the Global Event Handler is also executed on the distributed node. This is not desirable.

My question: is it possible to force Global Event Handlers to execute only on our XI server and not on the distributed mod_gearman nodes?

Re: Event Handlers and distributed monitoring with gearman

Posted: Fri Aug 05, 2016 2:04 pm
by rkennedy
If you remove the event_handler file from the gearman worker, does that stop it from running?

Re: Event Handlers and distributed monitoring with gearman

Posted: Fri Aug 05, 2016 2:11 pm
by scottwilkerson
drug wrote:We use mod_gearman to distribute all of our checks to distributed nodes. We rely on the Global Event Handler component in order to execute a script that generates tickets within our ticketing system when faults occur.

We would like eventhandlers to execute on their respective distributed node. This works; however, when this is enabled the Global Event Handler is also executed on the distributed node. This is not desirable.

My question: is it possible to force Global Event Handlers to execute only on our XI server and not on the distributed mod_gearman nodes?
To clarify, are you saying the Global Event Handlers are firing on BOTH the XI server AND the mod_gearman nodes?

If this is the case, you could modify the xi_host_event_handler & xi_service_event_handler commands to check if it is on the XI server before processing the 2nd 1/2 of the command

Re: Event Handlers and distributed monitoring with gearman

Posted: Fri Aug 05, 2016 2:17 pm
by drug
scottwilkerson wrote: To clarify, are you saying the Global Event Handlers are firing on BOTH the XI server AND the mod_gearman nodes?

If this is the case, you could modify the xi_host_event_handler & xi_service_event_handler commands to check if it is on the XI server before processing the 2nd 1/2 of the command
The Global Event Handler executes as desired on the XI server. However, if I enable eventhandlers for gearman (i.e. by appending "eventhandler=yes" to the "broker_module" setting within Nagios), the Global Event Handler is executed (or tries to) on the mod_gearman nodes.

Re: Event Handlers and distributed monitoring with gearman

Posted: Fri Aug 05, 2016 2:26 pm
by scottwilkerson
I just re-read through the mod_gearman documentation and I do not see any way to prevent global event handlers from being sent to the workers