mod_gearman help please
Posted: Wed Nov 25, 2015 4:35 am
I now have mod_gearman working with 2 worker nodes in a distributed environment.
However I now need to restrict one of the worker nodes to only do checks for certain hosts, this is because the main Nagios server cannot see these hosts over the VLANs its connected to.
The worker node can see these hosts and also the main Nagios server.
From what I read regarding how to do this I did the following:
In the main Nagios servers mod_gearman_neb.conf file I put:
queue_custom_variable=WORKER
In the host definition in Nagios I put:
_WORKER hostgroup_test
And in the worker nodes mod_gearman_worker.conf file I put:
hostgroups=test
So that worker node should only be doing checks for the host that has the _WORKER variable against it.
I restarted the worker node process on the worker node and gearmand on the main Nagios server.
The worker node is doing checks for the specified host but is also doing host and service checks for other hosts that do not have that custom variable.
Am I missing something?
My config files are as follows:
My mod_gearman_neb.conf file on the main Nagios server:
debug=3
logfile=/var/log/mod_gearman/mod_gearman_neb.log
server=localhost:4730
eventhandler=yes
services=yes
hosts=yes
hostgroups=Non_Distributed
servicegroups=INTERFACE_CHECKS
do_hostchecks=yes
encryption=no
key=<secret>
use_uniq_jobs=on
localhostgroups=Non_Distributed
localservicegroups=INTERFACE_CHECKS,WEBSITE_CHECKS
queue_custom_variable=WORKER
result_workers=1
perfdata=yes
perfdata_mode=1
orphan_host_checks=yes
orphan_service_checks=yes
accept_clear_results=no
mod_gearman_worker.conf on the remote host:
debug=3
logfile=/var/log/mod_gearman/mod_gearman_worker.log
server=10.51.1.35:4730
eventhandler=yes
services=yes
hosts=yes
hostgroups=test
do_hostchecks=yes
encryption=no
key=<secret>
job_timeout=60
min-worker=5
max-worker=50
idle-timeout=30
max-jobs=1000
spawn-rate=1
fork_on_exec=no
show_error_output=yes
enable_embedded_perl=on
use_embedded_perl_implicitly=off
use_perl_cache=on
p1_file=/usr/share/mod_gearman/mod_gearman_p1.pl
workaround_rc_25=off
However I now need to restrict one of the worker nodes to only do checks for certain hosts, this is because the main Nagios server cannot see these hosts over the VLANs its connected to.
The worker node can see these hosts and also the main Nagios server.
From what I read regarding how to do this I did the following:
In the main Nagios servers mod_gearman_neb.conf file I put:
queue_custom_variable=WORKER
In the host definition in Nagios I put:
_WORKER hostgroup_test
And in the worker nodes mod_gearman_worker.conf file I put:
hostgroups=test
So that worker node should only be doing checks for the host that has the _WORKER variable against it.
I restarted the worker node process on the worker node and gearmand on the main Nagios server.
The worker node is doing checks for the specified host but is also doing host and service checks for other hosts that do not have that custom variable.
Am I missing something?
My config files are as follows:
My mod_gearman_neb.conf file on the main Nagios server:
debug=3
logfile=/var/log/mod_gearman/mod_gearman_neb.log
server=localhost:4730
eventhandler=yes
services=yes
hosts=yes
hostgroups=Non_Distributed
servicegroups=INTERFACE_CHECKS
do_hostchecks=yes
encryption=no
key=<secret>
use_uniq_jobs=on
localhostgroups=Non_Distributed
localservicegroups=INTERFACE_CHECKS,WEBSITE_CHECKS
queue_custom_variable=WORKER
result_workers=1
perfdata=yes
perfdata_mode=1
orphan_host_checks=yes
orphan_service_checks=yes
accept_clear_results=no
mod_gearman_worker.conf on the remote host:
debug=3
logfile=/var/log/mod_gearman/mod_gearman_worker.log
server=10.51.1.35:4730
eventhandler=yes
services=yes
hosts=yes
hostgroups=test
do_hostchecks=yes
encryption=no
key=<secret>
job_timeout=60
min-worker=5
max-worker=50
idle-timeout=30
max-jobs=1000
spawn-rate=1
fork_on_exec=no
show_error_output=yes
enable_embedded_perl=on
use_embedded_perl_implicitly=off
use_perl_cache=on
p1_file=/usr/share/mod_gearman/mod_gearman_p1.pl
workaround_rc_25=off