Event Handlers and distributed monitoring with gearman

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
drug
Posts: 86
Joined: Wed Apr 03, 2013 3:19 pm

Event Handlers and distributed monitoring with gearman

Post 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?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Event Handlers and distributed monitoring with gearman

Post by rkennedy »

If you remove the event_handler file from the gearman worker, does that stop it from running?
Former Nagios Employee
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Event Handlers and distributed monitoring with gearman

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
drug
Posts: 86
Joined: Wed Apr 03, 2013 3:19 pm

Re: Event Handlers and distributed monitoring with gearman

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Event Handlers and distributed monitoring with gearman

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked