Mod-Gearman Plugin Folder

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
OptimusB
Posts: 146
Joined: Mon Oct 27, 2014 10:08 pm
Location: Canada
Contact:

Mod-Gearman Plugin Folder

Post by OptimusB »

I am looking for guidance on where to store plugins in our gearman worker boxes. I am getting notifications from XI that my worker does not have the plugin but I am not sure where to put them.

Code: Select all

CRITICAL: Return code of 127 is out of bounds. Make sure the plugin you're trying to run actually exists. (worker: worker02)
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Mod-Gearman Plugin Folder

Post by ssax »

You can compile nagios plugins and install, then add additional ones you've created to the standard /usr/local/nagios/libexec directory.
OptimusB
Posts: 146
Joined: Mon Oct 27, 2014 10:08 pm
Location: Canada
Contact:

Re: Mod-Gearman Plugin Folder

Post by OptimusB »

Sorry I am not following. The Gearman worker boxes does not have any nagios folder in it. As per their instructions by Mod Gearman, plugins must be added to the gearman boxes locally. I am looking for the folder to place them.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Mod-Gearman Plugin Folder

Post by tgriep »

The default location to install the plugins is here

Code: Select all

/usr/local/nagios/libexec
Be sure to check out our Knowledgebase for helpful articles and solutions!
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Mod-Gearman Plugin Folder

Post by jdalrymple »

I might be able to offer a more thorough answer here - mod_gearman actually pulls down all the information it needs from the job server. This dude interprets macros for you so that when they get to gearman they've already been all expanded out.

With that said you're going to want your plugins in the same location on all the servers, that location by default is what tgriep pointed out.

To doublecheck you typically would find it defined as the $USER1$ macro in /usr/local/nagios/etc/resources.cfg file

Hopefully that helps.
OptimusB
Posts: 146
Joined: Mon Oct 27, 2014 10:08 pm
Location: Canada
Contact:

Re: Mod-Gearman Plugin Folder

Post by OptimusB »

Thanks for the explanation and that's what I was looking for.

I also have one more question regarding Mod_Gearman. How does it handle "localhost" checks or should I change the hostname? If say a worker node checks "localhost" it isn't going to return the correct value.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Mod-Gearman Plugin Folder

Post by jdalrymple »

You have to be careful. "localhost" is a special case because all of it's checks are local checks whereas remote systems are remote checks. mod_gearman cannot take care of that for you... it will report its own status for localhost. 2 ways to deal with it.

1) Change all of your localhost checks to use NRPE and attach at the external IP, not 127.0.0.1.

2) setup a hostgroup for localhost that will prevent all the remote workers from grabbing its hosts/services.

Good catch on your part.
OptimusB
Posts: 146
Joined: Mon Oct 27, 2014 10:08 pm
Location: Canada
Contact:

Re: Mod-Gearman Plugin Folder

Post by OptimusB »

So my understanding is that if I specify a hostgroup in the mod_gearman_worker config, then that worker will only perform checks of that hostgroup? Is that correct? If so, is there anyway to specify workers to do everything BUT this localhost group?
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Mod-Gearman Plugin Folder

Post by jdalrymple »

This is the best option:
The Docs wrote:Server Options
Additional options for the NEB module only:
localhostgroups
sets a list of hostgroups which will not be executed by gearman. They are just passed through.

Code: Select all

localhostgroups=name1,name2,name3
It will pass through and be processed by Nagios.
Locked