Page 1 of 2
EventHandler on Distribute Nagios XI - GEARMAN
Posted: Tue Sep 22, 2015 12:37 pm
by lb2cons
Hello everyone! I'm using the architecture above on Nagios XI. Every hostgroup have it's own worker and it's on a different network.
distribute.png
I'm trying to use eventhandlers but mod_gearman doesn't send those checks to the worker, only service and host. This is a limitation? Am I doing something wrong?
The integration was made using the following guide:
https://assets.nagios.com/downloads/nag ... ios_XI.pdf
Re: EventHandler on Distribute Nagios XI - GEARMAN
Posted: Tue Sep 22, 2015 1:58 pm
by tgriep
It should work if you edit the nagios.cfg file and edit the broker line to change eventhandler to yes like below.
Code: Select all
broker_module=/usr/lib/mod_gearman/mod_gearman.o config=/etc/mod_gearman/mod_gearman_neb.conf eventhandler=yes
You will have to restart the Nagios process, Gearman server and workers for it to be taken in effect.
Remember, all of the remote work's will also have to be able to run the eventhandlers so they will need to be configured before hand.
Re: EventHandler on Distribute Nagios XI - GEARMAN
Posted: Tue Sep 22, 2015 4:58 pm
by lb2cons
tgriep wrote:all of the remote work's will also have to be able to run the eventhandlers so they will need to be configured before hand.
You are telling that the worker must know the script of the eventhandler or that I must also alter eventhander property from:
eventhandler=no
to:
eventhandler=yes
on every single worker?
Re: EventHandler on Distribute Nagios XI - GEARMAN
Posted: Wed Sep 23, 2015 9:09 am
by jdalrymple
lb2cons wrote:worker must know the script of the eventhandler
Yes, an event handler is run locally, in the context of a gearman worker, locally means on the server hosting the worker.
lb2cons wrote:or that I must also alter eventhander property from:
eventhandler=no
to:
eventhandler=yes
on every single worker?
This also - not every single worker, but every one that you want to process event handlers.
Re: EventHandler on Distribute Nagios XI - GEARMAN
Posted: Fri Sep 25, 2015 7:07 pm
by lb2cons
Ok, got it. I'll try this as soon as possible.
Re: EventHandler on Distribute Nagios XI - GEARMAN
Posted: Sun Sep 27, 2015 4:17 pm
by tgriep
Let us know if you need any more help.
Re: EventHandler on Distribute Nagios XI - GEARMAN
Posted: Mon Sep 28, 2015 7:15 am
by lb2cons
It was already configured. Check my broker config:
broker_module=/usr/lib64/mod_gearman/mod_gearman.o key=mykey server=myIP eventhandler=yes hosts=yes services=yes hostgroups=ABC,XXX,YYY
Worker:
eventhandler=yes
services=no
hosts=no
hostgroups=ABC
It's ok right? It's not working.
Re: EventHandler on Distribute Nagios XI - GEARMAN
Posted: Mon Sep 28, 2015 8:49 am
by tgriep
Check and see if eventhandler=yes is set in the gearmand server config file.
Code: Select all
/etc/mod_gearman/mod_gearman_neb.conf
If it isn't, set it to yes and restart the gearmand server.
If it still isn't working, take a look at the log files in /var/log/mod_gearman/ folder and post any errors here.
Re: EventHandler on Distribute Nagios XI - GEARMAN
Posted: Mon Sep 28, 2015 1:26 pm
by lb2cons
Yes it's eventhandler=yes on both /etc/mod_gearman/mod_gearman_neb.conf Nagios Server and on the worker.
I've debugged here, there is no error log on Worker nor in gearmand. The eventhandler it's been executed but by the local worker (Inside the Nagios XI Server)
Re: EventHandler on Distribute Nagios XI - GEARMAN
Posted: Mon Sep 28, 2015 2:57 pm
by tgriep
On your gearman server, usually this is the XI system, can you run the following command to view the workers that are connected to it and also in the eventhandler worker is connected to the server?
The output of the gearman_top should look something like below showing the eventandler is connected to the queue.
Code: Select all
+---------------+------------------+--------------+--------------+
| Queue Name | Worker Available | Jobs Waiting | Jobs Running |
+---------------+------------------+--------------+--------------+
| check_results | 1 | 0 | 0 |
| eventhandler | 50 | 0 | 0 |
| host | 50 | 0 | 1 |
| service | 50 | 0 | 13 |
+---------------+------------------+--------------+--------------+