Gearman hostgroup and servicegroups

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Gearman hostgroup and servicegroups

Post by BanditBBS »

Ugh, I thought I was done messing with my gearman setup, but alas, I am not.

Current working setup:
NagiosXI server with gearmand and mod_gearman_worker running.
Secondary server with worker running.
Checks being distributed between the 2 workers and everything working fine....YAY!

Changes to setup:
Added a new worker that will be checking specific systems behind a firewall. All firewall changes are complete and verified working to allow the gearman server to communicate with the worker behind the firewall.
I added a test system into XI and made it a member of the specific host_group that the new worker is configured to check. With this setup, the checks sometimes worked, sometimes did not. I had to create a new service_group and add all the services on that server to that group. I then configured the new worker to process those checks. The checks all went to the proper gearman worker now.

My question(s):
Shouldn't all services for a host go to the worker the host is configured to go to? Otherwise, whats the purpose of only checking a host on a specific worker but not its services?
My issue with this is I was not going to need service_groups and now I am going to be forced to use them and it will be huge with the number of services that will be member of the new one.

Thanks for any insight!
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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Gearman hostgroup and servicegroups

Post by slansing »

I'll just add some input here, you need to add the hostgroup to the neb.conf file on the Nagios system, and the same hostgroup definition to the worker config file on your remote machine. By defining the hostgroups and not service groups it should greatly cut down on the amount of configuration you need to do. Does that make sense? I see that you said the checks sometimes did not work. Could you go into a little bit more detail on this? What did you see that makes you say this.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Gearman hostgroup and servicegroups

Post by BanditBBS »

slansing wrote:I'll just add some input here, you need to add the hostgroup to the neb.conf file on the Nagios system, and the same hostgroup definition to the worker config file on your remote machine. By defining the hostgroups and not service groups it should greatly cut down on the amount of configuration you need to do. Does that make sense? I see that you said the checks sometimes did not work. Could you go into a little bit more detail on this? What did you see that makes you say this.
Yea, I modified the neb configuration on the server and the worker config on the worker. When I did that, the services were bouncing between critical and ok. My assumption at that point was the service checks were not going to the worker that is configured for the host all the time and sometimes going to the other workers. That explain it better?

So if the host is configured for a specific worker, the services on that host should go to the same worker? That is how I thought it worked, but I just wasn't seeing that in action when I tried it.
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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Gearman hostgroup and servicegroups

Post by slansing »

That is strange, it should work fine. We just duplicated this on our end and they seemed to be functioning fine. I will set up another round of tests and let it run for a while to see what I come up with.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Gearman hostgroup and servicegroups

Post by BanditBBS »

Thanks, I'm going to continue testing as well, it is very possible I did something stupid.
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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Gearman hostgroup and servicegroups

Post by scottwilkerson »

something to consider, after changing the neb config you need to restart nagios for the changes to take affect.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Gearman hostgroup and servicegroups

Post by BanditBBS »

scottwilkerson wrote:something to consider, after changing the neb config you need to restart nagios for the changes to take affect.
Well now, that is interesting, thought I just needed to restart gearmand. I'll do that when I get back to testing, other stuff has my attention at the moment.
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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Gearman hostgroup and servicegroups

Post by scottwilkerson »

Ya, that is a common misconception. There are actually 3 pieces to the puzzle...

gearmand - just job server
mod_gearman_neb - loaded via nagios broker and uses /etc/mod_gearman/mod_gearman_neb.conf

mod_gearman_worker - started via service mod_gearman_worker and uses /etc/mod_gearman/mod_gearman_worker.conf
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Gearman hostgroup and servicegroups

Post by BanditBBS »

To make sure I have it all setup properly before restarting Nagios, lets make sure I have the other stuff configured properly.

mod_gearman_neb on the XI server has this in the file:

Code: Select all

eventhandler=no
services=yes
hosts=yes
hostgroups=ae_direct_wrn
#servicegroups=
The worker node I want to handle the hosts belonging to ae_direct_wrn has this in the mod_gearman_worker:

Code: Select all

eventhandler=no
services=yes
hosts=yes
hostgroups=ae_direct_wrn
#servicegroups=name1,name2,name3
Is that the correct setup? That of course isn't all the config file contents, just the parts that pertain.
My last question is, in some other forum post a few months ago, I was told by someone(I think Mike, but not sure), that I should turn event_handler to no. Why is that? Can I not distribute the event handlers as well?
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
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Gearman hostgroup and servicegroups

Post by BanditBBS »

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
Locked