Gearman Load Balancer Configuration

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Gearman Load Balancer Configuration

Post by rajasegar »

NagiosXI 2014R1.2
check_gearman: version 1.4_nagios4 running on libgearman 0.25

I have setup 2 server instances for gearman load balancer.

Can someone give me the steps to do the following
1) Configure gearman slave on the new servers
2) Redirect only requests from particular VLAN segment to this server 1. i.e only 10.10.10.0 & 10.10.11.0 etc
3) Redirect only requests from particular VLAN segment to this server 2. i.e only 10.10.15.0 etc
4) The rest of the VLAN requests stays in the main Nagios server.

Thanks
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Gearman Load Balancer Configuration

Post by abrist »

1) This is done the way that documentation outlines:
https://labs.consol.de/nagios/mod-gearm ... figuration
2 & 3) You will need to create a hostgroup/servicegroup for each of the gearman servers and then add the checks for each vlan segment to the respective groups. This needs to be done as these groups are how gearman will know which gearman worker to run the checks from. Please read the documentation linked above to familiarize yourself with the configuration options.
4) Easy. As long as your gearman workers are configured to only run checks for specific groups as outlined above, the rest of the checks will still run from the XI server.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: Gearman Load Balancer Configuration

Post by rajasegar »

abrist wrote:1) This is done the way that documentation outlines:
https://labs.consol.de/nagios/mod-gearm ... figuration
2 & 3) You will need to create a hostgroup/servicegroup for each of the gearman servers and then add the checks for each vlan segment to the respective groups. This needs to be done as these groups are how gearman will know which gearman worker to run the checks from. Please read the documentation linked above to familiarize yourself with the configuration options.
4) Easy. As long as your gearman workers are configured to only run checks for specific groups as outlined above, the rest of the checks will still run from the XI server.

I still don't get how to define a hostgroup/servicegroup to a specific gearman worker.

Code: Select all

hostgroups

    sets a list of hostgroups which will go into seperate queues.             //which queue ??
    hostgroups=name1,name2,name3

servicegroups

    sets a list of servicegroups which will go into seperate queues.        //which queue ??  
    servicegroups=name1,name2,name3
Thanks
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Gearman Load Balancer Configuration

Post by Box293 »

On the master server you define the queues in mod_gearman_neb.conf

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=name1
#hostgroups=name2,name3


# sets a list of servicegroups which will go into seperate
# queues.
#servicegroups=name1,name2,name3
On the specific workers, you define the queues you want them to work on in mod_gearman_worker.conf

Code: Select all

# sets a list of hostgroups which this worker will work
# on. Either specify a comma seperated list or use
# multiple lines.
#hostgroups=name1
#hostgroups=name2,name3


# sets a list of servicegroups which this worker will
# work on.
#servicegroups=name1,name2,name3
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: Gearman Load Balancer Configuration

Post by rajasegar »

Box293 wrote:On the master server you define the queues in mod_gearman_neb.conf

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=name1
#hostgroups=name2,name3


# sets a list of servicegroups which will go into seperate
# queues.
#servicegroups=name1,name2,name3
On the specific workers, you define the queues you want them to work on in mod_gearman_worker.conf

Code: Select all

# sets a list of hostgroups which this worker will work
# on. Either specify a comma seperated list or use
# multiple lines.
#hostgroups=name1
#hostgroups=name2,name3


# sets a list of servicegroups which this worker will
# work on.
#servicegroups=name1,name2,name3
Ok. Thanks. Will try it out
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Gearman Load Balancer Configuration

Post by abrist »

Great, keep us updated as to your progress.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: Gearman Load Balancer Configuration

Post by rajasegar »

I setup another worker server as the second worker.
Created a hostgroup for a bunch of servers and set the hostgroups.

Job Server - mod_gearman_neb.conf
hostgroups=LOAD_BALANCER_MSB
Worker 1 - hostgroups option is remarked.

Server 2
Worker 2 - mod_gearman_worker.conf
hostgroups=LOAD_BALANCER_MSB

The problem is almost all the checks are now going to server 2 instead of those related to LOAD_BALANCER_MSB only.
Both servers are in the same segment.
Since firewall rules and routing are not open for both servers most of the checks fails.

Does anyone have any idea what is happening?
In Dev it sort of works fine with the same settings. Occasionally host checks from unrelated servers are sent to worker2.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Gearman Load Balancer Configuration

Post by tgriep »

You posted
Since firewall rules and routing are not open for both servers most of the checks fails.
Unless you can fix the firewall and routing, you will have to setup separate hostgroups for each worker that can reach the hosts that you want to check remotely.

Can you post the gearman server and worker configuration files for those servers?
Be sure to check out our Knowledgebase for helpful articles and solutions!
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: Gearman Load Balancer Configuration

Post by rajasegar »

tgriep wrote:You posted
Since firewall rules and routing are not open for both servers most of the checks fails.
Unless you can fix the firewall and routing, you will have to setup separate hostgroups for each worker that can reach the hosts that you want to check remotely.

Can you post the gearman server and worker configuration files for those servers?
I only added the hostgroup that the second server should handle but everything is going to it.
I have reverted back the configuration to default since it was not working.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: Gearman Load Balancer Configuration

Post by rajasegar »

Does anybody have any idea how to configure the worker host groups that works as expected?
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
Locked