Page 1 of 3

Check_HP plugin installation and use

Posted: Mon Dec 08, 2014 5:47 am
by szkoda
Hi All,

Having finally managed to get the latest version Nagios Core installed on a VM and have it monitor server windows servers both local and remote, I am now looking to have it monitor a bit more in-depth on each host.

I chose the HP_Check plugin which looks like it will do everything I need it to but am having some trouble getting it to work. I have extracted and placed the plugin in my Nagios plugins folder (\usr\local\nagios\libexec), added a service definition and a command definition and added these to a host. I then restarted Nagios which didn't throw up any errors but when I check the server in Nagios I have an error: "(Return code of 13 is out of bounds)" - I'm clearly missing something but I just don't know what it is!

I have configured SMNP on the windows host that I am trying to monitor and pretty sure I've forwarded the ports correctly - not sure if there is a way to confirm this?

Let me know if you need me to paste any of my service, command definitions etc.

If it helps I'm running the latest version of Ubuntu along with the latest version of Nagios.

If it helps I get the same error message when I try to run the plugin from the terminal. Even as "Sudo" I get a permissions error.

I've tried setting the permissions on the file but it doesn't seem to make any difference.

Re: Check_HP plugin installation and use

Posted: Mon Dec 08, 2014 11:34 am
by lgroschen
Please post your command definition that HP_check is using and make sure to add any agruments that are being sent. This could mean you simply forgot a space or aren't using an argument correctly. Also you can try the --help with the plugin and see if you arguments are following their argument formatting.

Re: Check_HP plugin installation and use

Posted: Mon Dec 08, 2014 12:04 pm
by emislivec
Please do post the service and command definitions. Could you also post the output of a "ls -l" on the plugin file?

Are you using check_hp? From their README
Please update the 'lib' path at the top of check_hp to fit your distribution.
check_hp needs to locate the utils.pm library that comes with nagios-plugins.

You will need the Net::SNMP package as well. In most distributions this is available
as a package named "libsnmp-perl" - so make sure to install it if you stumble accross
an error starting with "Can't locate Net/SNMP.pm in @INC [...]".
The "(Return code of 13 is out of bounds)" message indicates a permission issue, so you might need to change the lib path to

Code: Select all

use lib "/usr/lib/nagios/plugins"; 
if you installed plugins from the Ubuntu repositories.

Re: Check_HP plugin installation and use

Posted: Tue Dec 09, 2014 9:32 am
by szkoda
I'm a little confused - I have two plugins folders from what I can see:

/usr/local/nagios/libexec

/usr/lib/nagios/plugins

which one should the check_hp plugin be in?

I have also changed the "use lib" path as suggested but the error is the same. If it helps I installed the plugin manually (i.e. I downloaded it from Nagios Exchange and placed it in both plugins folders above).

I'll send you my service and command definitions now - but pretty sure they are wrong also!

Re: Check_HP plugin installation and use

Posted: Tue Dec 09, 2014 10:32 am
by slansing
It may all be pointing to the wrong location, I'm not sure why you have two different plugins directories, you may have tried to install it two different ways. With a typical centos/rhel installation, "/usr/local/nagios/libexec" is the one that is used by default at build time. Can you post the ls -l of that plugin? As of right now, if you cannot find that plugin where you think you put it, we would have no idea either.

Re: Check_HP plugin installation and use

Posted: Tue Dec 09, 2014 10:38 am
by szkoda
I've never used the ls -l command before - would you be able to let me know the full code for it please?

Re: Check_HP plugin installation and use

Posted: Tue Dec 09, 2014 10:41 am
by slansing
It's just a modifier for "ls" so you would do something like so:

Code: Select all

ls -l /path/to/where/you/put/the/plugin/pluginname
That will let us know (among other things) what the permissions are on the file itself. Since Linux is essentially all a conglomeration of files, permissions between them are highly important.

Re: Check_HP plugin installation and use

Posted: Tue Dec 09, 2014 11:18 am
by szkoda
This is what I get when I type the code:

"-rwxr-x—x 1 nagios Nagios 14795 Dec 4 12:22 /usr/local/Nagios/libexec/check_hp"

Currently the "check_hp" file I downloaded I put in both folders to be safe - Is there a way to tell which one Nagios is using?

Re: Check_HP plugin installation and use

Posted: Tue Dec 09, 2014 11:52 am
by lgroschen
I would imagine the nagios Nagios is wrong since the group should be lower case nagios as well. Maybe you just mistyped that part?

Re: Check_HP plugin installation and use

Posted: Tue Dec 09, 2014 11:55 am
by szkoda
Sorry typo, should be "nagios nagios"