Hi All,
I met a problem on distributed Nagios, deployed by mod_gearman (version:3). 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
Eventhandler in Distrubuted Nagios (Mod_Gearman)
Re: Eventhandler in Distrubuted Nagios (Mod_Gearman)
Change this in the /etc/mod_gearman/module.cfg:
to:
A copy of the handler should exist on the mod gearman workers - it usually needs to be under /usr/local/nagios/libexec or wherever the plugins are stored. Restart the modgearman service after making the change and verifying a copy of the event handler is on the gearman worker.
Code: Select all
eventhandler=no
Code: Select all
eventhandler=yes
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Eventhandler in Distrubuted Nagios (Mod_Gearman)
Hi, Thanks for your reply.
I've tried
1. change the eventhandler = yes at Nagios master, and stop nagios--> restart mod gearman --> start nagios. and perform the nagios and work.service restart at Nagios Slave
2. stop the test service at test PC, but no luck.
at Nagios Master, /usr/local/nagios/var/nagios.log. it shows SERVICE ALERT: XXXX;Check_Service;CRITICAL;HARD;3;CRITICAL: spooler=stopped (auto), delayed (). There is nothing shown at Nagios Slave. I checked, that script in the correct path at Nagios Slave. I ran this script manually, it can restart the target service. So would you please provide some inputs about this. THanks very much.
I've tried
1. change the eventhandler = yes at Nagios master, and stop nagios--> restart mod gearman --> start nagios. and perform the nagios and work.service restart at Nagios Slave
2. stop the test service at test PC, but no luck.
at Nagios Master, /usr/local/nagios/var/nagios.log. it shows SERVICE ALERT: XXXX;Check_Service;CRITICAL;HARD;3;CRITICAL: spooler=stopped (auto), delayed (). There is nothing shown at Nagios Slave. I checked, that script in the correct path at Nagios Slave. I ran this script manually, it can restart the target service. So would you please provide some inputs about this. THanks very much.
Re: Eventhandler in Distrubuted Nagios (Mod_Gearman)
To get gearman to handle events you would also need to edit your /usr/local/nagios/etc/nagios.cfg and remove the eventhandler=no option from the mod_gearman broker line and restart the nagios service:
If you do that you would need to make sure all the event handler plugins exist on the workers as well.
Make sure you do this on a test system first to make sure it doesn't impact your monitoring/notifications.
Code: Select all
broker_module=/usr/lib64/mod_gearman/mod_gearman_nagios4.o config=/etc/mod_gearman/module.conf eventhandler=noMake sure you do this on a test system first to make sure it doesn't impact your monitoring/notifications.
Re: Eventhandler in Distrubuted Nagios (Mod_Gearman)
Hi, Thanks very much, I've followed your proposal and got the successful result. Thanks Both again. These inputs are very helpful
Re: Eventhandler in Distrubuted Nagios (Mod_Gearman)
Great!! .... ticket locked!!