mod_gearman integration

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
bchabotdg
Posts: 34
Joined: Wed Aug 16, 2017 2:33 pm

mod_gearman integration

Post by bchabotdg »

Hello,

I'm running Nagios XI on CentOS 7.

I have followed the instructions at https://assets.nagios.com/downloads/nag ... ios_XI.pdf

I installed the server and a worker on the same system as the Nagios XI install. It seems to be working well so far.

I installed a remote worker and configured it to talk with the server. gearman_top2 shows the remote worker correctly.

I configured the remote worker to (I think) run the checks for a certain service group, viz:
servicegroups=my-service-group

Similarly with the hostgroups line.

I restart the workers and the server just to be safe. gearman_top2 shows all looks OK.

I then select certain services and hosts to be run by the remote worker and add them to the appropriate groups.

Apply changes in Nagios XI.

Tail log on remote worker and ............nothing. It isn't taking the services. The localhost worker is taking them on.

Did I miss something vital here? Is there something I can check to find out why these service groups aren't being handled by the remote worker?

(Spelling has been checked and is correct. I was goign to install ModGearman XI Manager but can't find a working module file to upload... not sure if that would even help...)

Thanks ahead for any info you might be able to provide.

Brian
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: mod_gearman integration

Post by scottwilkerson »

did you add the config line to nagios.cfg and restart nagios?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
bchabotdg
Posts: 34
Joined: Wed Aug 16, 2017 2:33 pm

Re: mod_gearman integration

Post by bchabotdg »

Erm... What line? I'm not seeing any mention of that in the current install doc (linked above).
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: mod_gearman integration

Post by scottwilkerson »

bchabotdg wrote:Erm... What line? I'm not seeing any mention of that in the current install doc (linked above).
Sorry, I forgot the script if that doc does it for you.

So by adding this to the remote worker it would be able to only process items in my-service-group

Code: Select all

servicegroups=my-service-group
But depending on the configuration on the local machine and the workers, the local worker is it has the rights may be picling up the checks.

Here is a doc outlining group setups using mod_gearman
https://support.nagios.com/kb/article.php?id=484
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
bchabotdg
Posts: 34
Joined: Wed Aug 16, 2017 2:33 pm

Re: mod_gearman integration

Post by bchabotdg »

So by adding this to the remote worker it would be able to only process items in my-service-group
Yes. That is what I want.

Machine 1 is Nagios XI, mod_gearman server, and a mod_gearman worker. This mod_gearman worker should handle all checks except my-service-group.

Machine 2 is the remote system running mod_gearman worker and should only handle service checks for my-service-group.

Machine 2 has the servicegroups=my-service-group line in the config file and the worker service has been restarted.

The remote worker on machine 2 shows correctly on gearman_top2

No service checks are being performed by machine 2 at all. It should be performing the ones in my-service-group

All service checks are being done by the gearman worker on machine 1.

Help?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: mod_gearman integration

Post by lmiltchev »

What kind of checks are these? Do you have the plugin, used by these services installed on the machine 2?
Be sure to check out our Knowledgebase for helpful articles and solutions!
bchabotdg
Posts: 34
Joined: Wed Aug 16, 2017 2:33 pm

Re: mod_gearman integration

Post by bchabotdg »

They are a mix of standard and custom checks. I've copied the libexec directory over to the remote server and locally tested them. They should have no problem running. The mod_gearman server isn't even trying to send them out.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: mod_gearman integration

Post by lmiltchev »

Can you post the module.conf and worker.conf files from both machines (the server and the worker)? Please remove sensitive info, e.g. IPs, keys, etc.
Be sure to check out our Knowledgebase for helpful articles and solutions!
bchabotdg
Posts: 34
Joined: Wed Aug 16, 2017 2:33 pm

Re: mod_gearman integration

Post by bchabotdg »

Can you post the module.conf and worker.conf files from both machines (the server and the worker)? Please remove sensitive info, e.g. IPs, keys, etc.

Code: Select all

[bchabot@[REMOTE] ~]$ cat /etc/mod_gearman2/module.conf | grep -v "#"
debug=1
logfile=/var/log/mod_gearman2/mod_gearman_neb.log
server=10.[REDACTED]:4730
eventhandler=yes
services=yes
hosts=yes
hostgroups=[my-host-group]
servicegroups=[my-service-group]
do_hostchecks=yes
route_eventhandler_like_checks=no
encryption=yes
key=[REDACTED]
use_uniq_jobs=on
localhostgroups=
localservicegroups=
result_workers=1
perfdata=no
perfdata_mode=1
orphan_host_checks=yes
orphan_service_checks=yes
accept_clear_results=no
[bchabot[REMOTE] ~]$ cat /etc/mod_gearman2/worker.conf | grep -v "#"
debug=1
logfile=/var/log/mod_gearman2/mod_gearman_worker.log
server=10.[REDACTED]:4730
eventhandler=yes
services=yes
hosts=yes
hostgroups=[my-host-group]
servicegroups=[my-service-group]
encryption=yes
key=[REDACTED]
job_timeout=60
min-worker=5
max-worker=50
idle-timeout=30
max-jobs=1000
spawn-rate=1
fork_on_exec=no
load_limit1=0
load_limit5=0
load_limit15=0
show_error_output=yes
enable_embedded_perl=on
use_embedded_perl_implicitly=off
use_perl_cache=on
p1_file=/usr/share/mod_gearman2/mod_gearman_p1.pl
workaround_rc_25=off
[bchabot@[REMOTE] ~]$ 

Code: Select all

[bchabot@[SERVER] ~]$ cat /etc/mod_gearman2/module.conf | grep -v "#"
debug=1
logfile=/var/log/mod_gearman2/mod_gearman_neb.log
server=localhost:4730
eventhandler=yes
services=yes
hosts=yes
do_hostchecks=yes
route_eventhandler_like_checks=no
encryption=yes
key=[REDACTED]
use_uniq_jobs=on
localhostgroups=
localservicegroups=
result_workers=1
perfdata=no
perfdata_mode=1
orphan_host_checks=yes
orphan_service_checks=yes
accept_clear_results=no
[bchabot@[SERVER] ~]$ cat /etc/mod_gearman2/worker.conf | grep -v "#"
debug=1
logfile=/var/log/mod_gearman2/mod_gearman_worker.log
server=localhost:4730
eventhandler=yes
services=yes
hosts=yes
encryption=yes
key=[REDACTED]
job_timeout=60
min-worker=5
max-worker=50
idle-timeout=30
max-jobs=1000
spawn-rate=1
fork_on_exec=no
load_limit1=0
load_limit5=0
load_limit15=0
show_error_output=yes
enable_embedded_perl=on
use_embedded_perl_implicitly=off
use_perl_cache=on
p1_file=/usr/share/mod_gearman2/mod_gearman_p1.pl
workaround_rc_25=off
[bchabot@[SERVER] ~]$
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: mod_gearman integration

Post by lmiltchev »

When you have:

Code: Select all

services=yes
hosts=yes
in the module.conf and worker.conf on the server, mod_gearman will run all host/service checks locally. You will need to change this to:

Code: Select all

services=no
hosts=no
In the module.conf, you need to specify all of your hostgroups/servicegroups, for example:

Code: Select all

services=no
hosts=no
hostgroups=[my-host-group1],[my-host-group2]
servicegroups=[my-service-group1],[my-service-group2]
On the local worker, you could have:

Code: Select all

services=no
hosts=no
hostgroups=[my-host-group1]
servicegroups=[my-service-group1]
On the remote worker, you could have:

Code: Select all

services=no
hosts=no
hostgroups=[my-host-group2]
servicegroups=[my-service-group2]
Basically, you are saying: "Don't run all of the host/service checks locally. Run group 1 checks locally, but group 2 checks - remotely".

Don't forget to restart the serivces after making the changes.

Let us know if this helped.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked