Yep, that's how I do it! Need more details?Smark wrote:So I have everything working, sort of. When looking at the hostgroups and servicegroups option in mod_gearman_worker.conf you can specify which hostgroups and which servicegroups should be executed by which workers.
In our environment we have servers dispersed around the world so it makes more sense to say "any services on hosts in this hostgroup should be checked by this worker". Does that functionality exist?
Distributed Nagios Architecture
Re: Distributed Nagios Architecture
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Re: Distributed Nagios Architecture
Yes! I'm looking at gearman_top and I see my hostgroup_Name queues:BanditBBS wrote:Yep, that's how I do it! Need more details?Smark wrote:So I have everything working, sort of. When looking at the hostgroups and servicegroups option in mod_gearman_worker.conf you can specify which hostgroups and which servicegroups should be executed by which workers.
In our environment we have servers dispersed around the world so it makes more sense to say "any services on hosts in this hostgroup should be checked by this worker". Does that functionality exist?
Code: Select all
2014-06-09 09:33:01 - localhost:4730 - v0.25
Queue Name | Worker Available | Jobs Waiting | Jobs Running
----------------------------------------------------------------------------
check_results | 1 | 0 | 0
eventhandler | 56 | 0 | 0
host | 56 | 0 | 0
hostgroup_Flagstaff Hosts | 13 | 0 | 0
hostgroup_Phoenix Hosts | 43 | 0 | 0
hostgroup_Sunnyvale Hosts | 13 | 0 | 0
service | 56 | 0 | 11
worker_flgnagiosgmdv1 | 1 | 0 | 0
worker_phxnagiosgmdv1 | 1 | 0 | 0
----------------------------------------------------------------------------I found it:
I'll try this out and report back unless you have something to add.queue_custom_variable
Can be used to define the target queue by a custom variable in addition to host/servicegroups. When set for ex. to WORKER you then could define a _WORKER custom variable for your hosts and services to directly set the worker queue. The host queue is inherited unless overwritten by a service custom variable. Set the value of your custom variable to local to bypass Mod-Gearman (Same behaviour as in localhostgroups/localservicegroups).
queue_custom_variable=WORKER
I hope the mods don't mind this conversation continuing in this thread. I think this will serve as a good reference to people in the future.
Thanks again for everyone's continued help.
Re: Distributed Nagios Architecture
mod_gearman_worker.conf file on one of the remote workers:
hosts=no
services=no
hostgroups=comma seperated list of hostgroups for this worker
Make sure those settings are set and then restart the mod_gearman_worker service on that worker. Any host(and all services on that host) in the hostgroup specified will go to that worker. Any host/service not in the specified hostgroup will not be sent to that worker and will be split up between workers that have host and service set to yes.
hosts=no
services=no
hostgroups=comma seperated list of hostgroups for this worker
Make sure those settings are set and then restart the mod_gearman_worker service on that worker. Any host(and all services on that host) in the hostgroup specified will go to that worker. Any host/service not in the specified hostgroup will not be sent to that worker and will be split up between workers that have host and service set to yes.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Re: Distributed Nagios Architecture
Ok, so I tried that here below:BanditBBS wrote:mod_gearman_worker.conf file on one of the remote workers:
hosts=no
services=no
hostgroups=comma seperated list of hostgroups for this worker
Make sure those settings are set and then restart the mod_gearman_worker service on that worker. Any host(and all services on that host) in the hostgroup specified will go to that worker. Any host/service not in the specified hostgroup will not be sent to that worker and will be split up between workers that have host and service set to yes.
Code: Select all
2014-06-09 10:11:14 - localhost:4730 - v0.25
Queue Name | Worker Available | Jobs Waiting | Jobs Running
------------------------------------------------------------------------
check_results | 1 | 0 | 0
eventhandler | 35 | 0 | 0
host | 25 | 0 | 0
hostgroup_Flagstaff | 30 | 0 | 0
hostgroup_Phoenix | 30 | 0 | 0
hostgroup_Sunnyvale | 30 | 0 | 0
service | 25 | 82 | 25
worker_flgnagiosgmdv1 | 1 | 0 | 0
worker_phxnagiosdv1 | 1 | 0 | 0
worker_phxnagiosgmdv1 | 1 | 0 | 0
------------------------------------------------------------------------
Example (flgnagiosgmdv1):
Code: Select all
# defines if the module should distribute execution of
# service checks.
services=no
# defines if the module should distribute execution of
# host checks.
hosts=no
# sets a list of hostgroups which will go into seperate
# queues. Either specify a comma seperated list or use
# multiple lines.
hostgroups=Flagstaff,SunnyvaleThe hostgroups out of Nagios XI Enterprise 2014R1.1 are specified in the hostgroup itself, not in the host (the hostgroup specifies the hosts in it).
Any idea what the problem could be here? I'll keep investigating.
Edit: Yes, I restarted the services after making these changes.
Re: Distributed Nagios Architecture
Wondering if you need to restart nagios as well. Just for grins on the main server restart gearmand and restart nagios and see if either of those resolves your issue. I can tell you without a doubt that I use it the way you show and it works great!
EDIT: Stupid question time: You do have hosts belonging to those hostgroups, right? If you look at hostgroup summary it does have numbers next to them?
EDIT #2: On the main server in the mod_gearman_neb.conf file, you do have those hostgroups listed in the hostgroup section, right?
Example:
After making changes to this, either nagios or gearmand needs restarted, can't remember which
EDIT: Stupid question time: You do have hosts belonging to those hostgroups, right? If you look at hostgroup summary it does have numbers next to them?
EDIT #2: On the main server in the mod_gearman_neb.conf file, you do have those hostgroups listed in the hostgroup section, right?
Example:
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=name2,name3
hostgroups=pci,dmz,win_corp,wdd
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Re: Distributed Nagios Architecture
huzzah! I had already made changes to [...]_neb.conf as a troubleshooting step. Looks like I had to restart nagios. To make it easy I rebooted the Nagios server.BanditBBS wrote:Wondering if you need to restart nagios as well. Just for grins on the main server restart gearmand and restart nagios and see if either of those resolves your issue. I can tell you without a doubt that I use it the way you show and it works great!
EDIT: Stupid question time: You do have hosts belonging to those hostgroups, right? If you look at hostgroup summary it does have numbers next to them?
EDIT #2: On the main server in the mod_gearman_neb.conf file, you do have those hostgroups listed in the hostgroup section, right?
Example:After making changes to this, either nagios or gearmand needs restarted, can't remember whichCode: Select all
# sets a list of hostgroups which will go into seperate # queues. Either specify a comma seperated list or use # multiple lines. #hostgroups=name2,name3 hostgroups=pci,dmz,win_corp,wdd
Looks good to me!
Code: Select all
2014-06-09 10:29:33 - localhost:4730 - v0.25
Queue Name | Worker Available | Jobs Waiting | Jobs Running
------------------------------------------------------------------------
check_results | 1 | 0 | 0
eventhandler | 89 | 0 | 0
host | 0 | 14 | 0
hostgroup_Flagstaff | 46 | 1 | 34
hostgroup_Phoenix | 43 | 0 | 30
hostgroup_Sunnyvale | 46 | 0 | 5
service | 0 | 10 | 0
worker_flgnagiosgmdv1 | 1 | 0 | 0
worker_phxnagiosgmdv1 | 1 | 0 | 0
------------------------------------------------------------------------Re: Distributed Nagios Architecture
I just do it manually believe it or not...its ugly!
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Distributed Nagios Architecture
rsync being pulled or pushed from a central readonly system would be my suggestion. Keep bandit's crazy manual replication away from your systems. 
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.