The following should help you, as long as I understand what it is that you're trying to do:
Yes, install x amount of remote workers that all share the same key.
Yes, install the same plugins and dependencies on all workers (I like to verify they are working by executing the plugins locally with the arguments that will be passed, but thats just *my* preference).
You should definitely monitor the workers! The whole point with this setup, though, is that you don't need to limit 1 ModGearman worker to performing checks for just 1 hostgroup or servicegroup. You can have multiple ModGearman workers performing the checks - this comes in handy when you need to take one machine down to upgrade, or for other miscellaneous maintenance. If you're limiting some checks to only be performed by 1 worker, then what you suggest here is a good idea. I like to give each queue (specific to hostgroups / servicegroups) at LEAST 2 workers (for the reasons I just mentioned).
So, before we go any further, lets define an example scenario.
You have 5 servers! You have 1 XI/ModGearman server (it has a few checks that need to be performed locally ONLY), 2 Worker Servers dedicated to perfoming checks on a specific hostgroup (We'll define this in a moment), and then 2 more Worker Servers dedicated to performing ALL other checks. In order, we'll call these servers: nagios, hostgroup_worker1, hostgroup_worker2, catchall_worker1, catchall_worker2 - this'll make the following break down a lot easier to understand.
On server nagios, your nagios configuration for this example should look something like (obviously this exact configuration isn't going to work, I left out some required directives for brevity - but I think this should get my point across):
Code: Select all
define hostgroup {
hostgroup_name local-only
alias local-only
}
define hostgroup {
hostgroup_name specific-only
alias specific-only
}
define host {
host_name localhost
alias localhost
address 127.0.0.1
hostgroups local-only
}
define host {
host_name host1
alias host1
address 192.168.1.1
hostgroups specific-only
}
define host {
host_name host2
alias host2
address 192.168.1.2
hostgroups specific-only
}
define host {
host_name host3
alias host3
address 192.168.1.3
}
define host {
host_name host4
alias host4
address 192.168.1.4
}
Here we have defined 2 hostgroups (local-only and specific-only), and 5 hosts (localhost, host1, host2, host3 and host4), hosts 1 and 2 belong to the specific-only hostgroup, and hosts 3 and 4 don't belong to any hostgroup.
With those definitions, we want localhost checks to not be picked up by ModGearman, and we want hosts host1 and host2 checks to be performed by servers hostgroup_worker1 and hostgroup_worker2, and hosts host3 and host4 checks to be performed by servers catchall_worker1 and catchall_worker2.
In order to accomplish that: on server nagios, in the /etc/mod_gearman2/module.conf, you should have the following directives set:
Code: Select all
hostgroups=specific-only
localhostgroups=local-only
Then restart nagios. Those settings will create a hostgroup queue specifically for the specific-only hostgroup, and declare that anything in the local-only hostgroup not be picked up by ModGearman! Make sure your ModGearman worker is not running on this machine - and its a good idea to disable it at boot with a
On hostgroup_worker1 and hostgroup_worker2 (these configurations should be identical!), in the /etc/mod_gearman2/worker.conf, you should have the following directives set:
Code: Select all
hosts=no
services=no
hostgroups=specific-only
You won't need to change the default settings on catchall_worker1 and catchall_worker2 in order to accomplish anything for this example (other than making sure your key matches!).
Hope this helps clear things up for you!