Page 1 of 1

Mod_Gearman Worker Hostgroups

Posted: Thu May 07, 2015 3:34 pm
by CFT6Server
I have defined a hostgroup to test the plugins and mod_gearman_worker.

1. I have added a host to a "test" hostgroup.
2. I have configured a specific worker to handle that hostgroup.
3. I perform a check from XI, and noticed that the check is running on the XI host instead.

Steps taken:

1. Went into HostGroup, created "test" and then added host to it.
2. edit the /etc/mod_gearman/mod_gearman_worker.conf on worker2. Restarted mod_gearman_worker.
3. enable debug and tail log on all worker nodes.
4. monitor gearman_top to confirm that the hostgroup is recognized.
5. Initiate a service check of the host => check performed via XI.

Ine added to /etc/mod_gearman/mod_gearman_worker.conf on woker 2

Code: Select all

hostgroup=test
Confirmation message from log on worker1 which is the XI servier

Code: Select all

[2015-05-07 13:32:40][9811][DEBUG] got service job: kdcnaggm01 - Memory Usage
Gearman Top showing the hostgroup

Code: Select all

2015-05-07 13:33:40  -  localhost:4730  -  v1.1.8

 Queue Name                      | Worker Available | Jobs Waiting | Jobs Running
----------------------------------------------------------------------------------
 check_results                   |               1  |           0  |           0
 eventhandler                    |              99  |           0  |           0
 host                            |              99  |           0  |           0
hostgroup_test                  |              25  |           0  |           0
 service                         |              99  |           0  |           0
 worker_kdcnaggm01               |               1  |           0  |           0
 worker_kdcnaggm02               |               1  |           0  |           0
 worker_kdcnaggm03               |               1  |           0  |           0
 worker_kdcnagxi01                |               1  |           0  |           0
----------------------------------------------------------------------------------
Did I miss anything here?

Re: Mod_Gearman Worker Hostgroups

Posted: Thu May 07, 2015 3:47 pm
by jolson
What does the mod_gearman conf file look like on your XI server?

Code: Select all

cat /etc/mod_gearman/mod_gearman_worker.conf
If the XI server is set up to handle your test hostgroup, it may pull the checks from the jobs queue.

Re: Mod_Gearman Worker Hostgroups

Posted: Thu May 07, 2015 3:49 pm
by jdalrymple
I don't see where that you specified the hostgroup in the neb conf:

Code: Select all

# sets a list of hostgroups which will go into seperate
# queues. Either specify a comma seperated list or use
# multiple lines.
#hostgroups=name1
#hostgroups=name2,name3

Re: Mod_Gearman Worker Hostgroups

Posted: Thu May 07, 2015 5:29 pm
by CFT6Server
This is the conf file of worker 2 that's configured with the hostgroup.
worker.conf
On top of configuring the conf on the worker node, do I also need to configure the server node?

Re: Mod_Gearman Worker Hostgroups

Posted: Thu May 07, 2015 7:31 pm
by Box293
On the Nagios XI server, you need to specify the hostgroups:

Code: Select all

/etc/mod_gearman/mod_gearman_neb.conf

hostgroups=test
Then restart Nagios.

Re: Mod_Gearman Worker Hostgroups

Posted: Fri May 08, 2015 10:59 am
by CFT6Server
Thanks. That's what I was missing. So the worker conf needs the hostgroups as well as the server needs the hostgroups defined in the neb conf.