Page 2 of 2

Re: mod_gearman integration

Posted: Fri Mar 16, 2018 2:15 pm
by bchabotdg
So do I need to specify a second hostgroup and a second servicegroup for services handled on the local server?

Can I specify no for services and hosts on the local box and not specify a hostgroup and servicefroup so as to indicate "Handle everything else locally"?

Re: mod_gearman integration

Posted: Fri Mar 16, 2018 4:00 pm
by lmiltchev
I did some more digging into this and testing, and I need to revise what I said. Even though, setting up:

Code: Select all

services=no
hosts=no
would work, the checks that are not put in queues won't be run by mod_gearman by only by nagios. So, a better solution would be:

In the module.conf on the gearman server:

Code: Select all

services=yes
hosts=yes
# Specify hostgroups and servicesgroups that you want to put in a queue, and run on the remote worker
hostgroups=MyHostgroup
servicegroups=MyServicegroup
In the worker.conf on the gearman server:

Code: Select all

services=yes
hosts=yes
You don't need to specify hostgroups or servicegroups here, and most definitely, you should not specify here hostgroups/servicegroups checks that need to be run remotely!

In the worker.conf on the remote worker:

# Make sure these are set to "no", so that only hostgroups/servicegroups in your queue would run

Code: Select all

services=no
hosts=no
# Specify hostgroup/servicegroup checks to be run
hostgroups=MyHostgroup
servicegroups=MyServicegroup
This way, the checks in the queue will run ONLY on the remote worker. All of the rest of the checks will run locally.