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?
Event Handlers and distributed monitoring with gearman
Re: Event Handlers and distributed monitoring with gearman
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
To clarify, are you saying the Global Event Handlers are firing on BOTH the XI server AND the mod_gearman nodes?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?
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
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 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
-
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
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