Page 1 of 1

Mod-Gearman Plugin Folder

Posted: Wed May 06, 2015 2:07 pm
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)

Re: Mod-Gearman Plugin Folder

Posted: Wed May 06, 2015 2:16 pm
by ssax
You can compile nagios plugins and install, then add additional ones you've created to the standard /usr/local/nagios/libexec directory.

Re: Mod-Gearman Plugin Folder

Posted: Wed May 06, 2015 2:36 pm
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.

Re: Mod-Gearman Plugin Folder

Posted: Wed May 06, 2015 2:48 pm
by tgriep
The default location to install the plugins is here

Code: Select all

/usr/local/nagios/libexec

Re: Mod-Gearman Plugin Folder

Posted: Wed May 06, 2015 3:23 pm
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.

Re: Mod-Gearman Plugin Folder

Posted: Wed May 06, 2015 4:05 pm
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.

Re: Mod-Gearman Plugin Folder

Posted: Wed May 06, 2015 4:09 pm
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.

Re: Mod-Gearman Plugin Folder

Posted: Thu May 07, 2015 3:43 pm
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?

Re: Mod-Gearman Plugin Folder

Posted: Thu May 07, 2015 3:53 pm
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.