Mod Gearman - Best Practices

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jacek
Posts: 255
Joined: Wed Sep 09, 2015 5:49 am

Mod Gearman - Best Practices

Post by jacek »

Hi,

I am trying out Mod Gearman in my environment, I followed these two instructions to get it running:
https://assets.nagios.com/downloads/nag ... ios_XI.pdf
https://support.nagios.com/kb/article.php?id=484

Now to the question:
Which out of the box plugins/checks/wizards I should avoid checking with Mod Gearman?
From the two articles I found any plugins that want to check something locally on the Nagios host (which makes sense) and all checks coming from the Router/Switch wizard, because they use MRTG which is local - is there an easy way to find/filter out all these?
Anything else coming from the OOTB Nagios XI?
If not then I think it would be worth to create such an list and reference it in these 2 articles.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Mod Gearman - Best Practices

Post by cdienger »

Configs with the name "local host" are meant to run on the local XI server so those should be excluded.

The BPI wizard/check is also meant to be local to the XI machine. Filtering services for BPI will usually bring them up.

MRTG checks can usually be found by searching for services with "Bandwidth" or "Status" in the name. Bandwidth checks are the ones to worry about since they will try to look at the local XI file system for files in /var/lib/mrtg/and also try to write to local rrd files.

The other checks should be doable on a remote system but may require installation or copying the plugins from the XI machine over to the remote gearman machine. check_ncpa or check_nrpe for example are found on the XI system but are not included in the default plugins at http://nagios-plugins.org/doc/man/index.html.

Some plugins may also require additional libraries or sdks installed on the remote machine - the Oracle and VMware checks for example.

I would probably try to exclude as much as possible from being sent to gearman at first and them move checks over in batches to make they're able to run properly.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
SteveBeauchemin
Posts: 524
Joined: Mon Oct 14, 2013 7:19 pm

Re: Mod Gearman - Best Practices

Post by SteveBeauchemin »

A couple suggestions. This is advanced stuff, so go slow. Be methodical.
Read every line in the /etc/mod_gearman config files.
module.conf only matters on the core host. Where you have nagios.cfg file.
worker.conf matters where you start the mod_gearman_worker services. Could be on core and remote servers both.

In /etc/mod_gearman/module.conf - the central server config.
I add these 2 items to help control what the gearman service will operate on. Actually to tell it what not to touch, like localhost.

Code: Select all

# sets a list of hostgroups which will not be executed
# by gearman. They are just passed through.
# Default is none
localhostgroups=Gearman-Exclude-Always-Hosts

# sets a list of servicegroups which will not be executed
# by gearman. They are just passed through.
# Default is none
localservicegroups=Gearman-Exclude-Always-Services
Some Nagios hostgroups I use.

Code: Select all

Gearman-Exclude-Always-Hosts  These only run on core
Gearman-Only-Hosts            These never run on core
Gearman-Only-on-worker-01     Only run tests on worker-01
Gearman-Only-on-worker-02     Only run tests on worker-02
Then in Nagios XI add things for gearman to exclude. Use the Hostgroups or Servicegroups.

Also, if you have multiple mod_gearman remote workers, sometimes you want items to run on a specific remote worker. Sometimes you don't care which worker runs the plugin, you just want it run. To do that, I add these to each worker.conf. Each remote host gets its own configuration. Each remote worker gets the 'Nagios Plugins' installed.

In /etc/mod_gearman/worker.conf - the worker config that is used remotely, and also can run on the central host. (I do both)
I add these items.

Code: Select all

# sets a list of hostgroups which this worker will work
# on. Either specify a comma separated list or use multiple lines.
#hostgroups=name1
#hostgroups=name2,name3
hostgroups=Gearman-Only-Hosts
hostgroups=Gearman-Only-on-worker-01

# sets a list of servicegroups which this worker will work on.
#servicegroups=name1
#servicegroups=name2,name3
servicegroups=Gearman-Only-Services
servicegroups=Gearman-Service-on-worker-01
The other remote worker would have worker-02 and so on.

Then, the hostgroup Gearman-Only-Hosts would run any test on any worker.
The hostgroup Gearman-Only-on-worker-01 would only run those tests on this particular worker.

That is about as complicated as I make my setup. I can exclude tests, I can add tests. I can send specific tests to specific locations.
That has worked for me for many years.

Start slow and simple. Use the mod_gearman log files on the remote systems to see what is happening. Don't let the logs fill up your drive.

use nagios.log, and the gearman and mod_gearman logs on your central server.

I hope this helps get you started. Consider this information a possible methodology.

Steve B
XI 5.7.3 / Core 4.4.6 / NagVis 1.9.8 / LiveStatus 1.5.0p11 / RRDCached 1.7.0 / Redis 3.2.8 /
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Mod Gearman - Best Practices

Post by cdienger »

Thanks for the input, @SteveBeauchemin!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
jacek
Posts: 255
Joined: Wed Sep 09, 2015 5:49 am

Re: Mod Gearman - Best Practices

Post by jacek »

@SteveBeauchemin, thanks a lot, in fact I'm aiming into setting up dedicated workers for specific sites, and after looking into your config I can confirm, that I understood the documentation pretty well.
Thanks!

Think we can close the topic, as I was only worried about some plugins that need to be run on the XI but were not listed in the articles I used.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Mod Gearman - Best Practices

Post by cdienger »

Sounds good. Locking thread.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked