EventHandler on Distribute Nagios XI - GEARMAN

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
lb2cons
Posts: 72
Joined: Mon Dec 08, 2014 4:11 pm

EventHandler on Distribute Nagios XI - GEARMAN

Post 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
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: EventHandler on Distribute Nagios XI - GEARMAN

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
lb2cons
Posts: 72
Joined: Mon Dec 08, 2014 4:11 pm

Re: EventHandler on Distribute Nagios XI - GEARMAN

Post 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?
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: EventHandler on Distribute Nagios XI - GEARMAN

Post 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.
lb2cons
Posts: 72
Joined: Mon Dec 08, 2014 4:11 pm

Re: EventHandler on Distribute Nagios XI - GEARMAN

Post by lb2cons »

Ok, got it. I'll try this as soon as possible.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: EventHandler on Distribute Nagios XI - GEARMAN

Post by tgriep »

Let us know if you need any more help.
Be sure to check out our Knowledgebase for helpful articles and solutions!
lb2cons
Posts: 72
Joined: Mon Dec 08, 2014 4:11 pm

Re: EventHandler on Distribute Nagios XI - GEARMAN

Post 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.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: EventHandler on Distribute Nagios XI - GEARMAN

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
lb2cons
Posts: 72
Joined: Mon Dec 08, 2014 4:11 pm

Re: EventHandler on Distribute Nagios XI - GEARMAN

Post 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)
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: EventHandler on Distribute Nagios XI - GEARMAN

Post 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?

Code: Select all

gearman_top
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           |
+---------------+------------------+--------------+--------------+
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked