Page 1 of 1

Eventhandler in Distrubuted Nagios (Mod_Gearman)

Posted: Thu Feb 25, 2021 2:49 am
by huaming
Hi All,

I met a problem on distributed Nagios, deployed by mod_gearman. I built a eventhandler for a certain service (check windows service), if this windows service stopped, this eventhandler will start it. HOwever, this eventhandler only work at Nagios Master ( with Mod_gearman module installed), not work on those workers. I am wondering I can seek some support/suggestions.

THanks.

Below is my configuration on /etc/mod_gearman/module.cfg at Nagios Master

#Mod-Gearman NEB Module Config
eventhandler=no
notifications=no
services=yes
hosts=yes
hostgroups=XXX_Host_Group,YYY_Host_Group,ZZZ_Host_Group
servicegroups=XXX_Service_Group,YYY_Service_Group,ZZZ_Service_Group

do_hostchecks=yes
route_eventhandler_like_checks=yes
encryption=yes
mum length is 32 characters.
key=******
use_uniq_jobs=on

This is configuration on /etc/mod_gearman/worker.cfg at Nagios slave

#Mod-Gearman NEB Module Config
eventhandler=yes
notifications=no
services=no
hosts=no
hostgroups=XXX_Host_Group
servicegroups=XXX_Service_Group

Re: Eventhandler in Distrubuted Nagios (Mod_Gearman)

Posted: Tue Mar 02, 2021 7:04 am
by IPOInS
Does the plugin/script exist in the libexec folder of the slave server?

Re: Eventhandler in Distrubuted Nagios (Mod_Gearman)

Posted: Tue Mar 02, 2021 8:21 pm
by huaming
Thanks for reply.

Yes, I put the same script at slave server. And there is no error shown in nagios.log at slave server. I ran the test for this script at slave server with successful result. :(

Re: Eventhandler in Distrubuted Nagios (Mod_Gearman)

Posted: Tue Mar 09, 2021 5:57 am
by IPOInS
Hi Huaming,

here's a couple of other things to check:
Firstly the module.conf, you want eventhandler enabled so that it gets placed into the mod_gearman queue for workers to pick up.
The other thing is check your nagios.cfg and see if eventhandler is enabled for the value broker_module.