Check_HP plugin installation and use

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
szkoda
Posts: 42
Joined: Thu Dec 04, 2014 8:48 am

Check_HP plugin installation and use

Post 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.
Last edited by szkoda on Mon Dec 08, 2014 10:54 am, edited 1 time in total.
User avatar
lgroschen
Posts: 384
Joined: Wed Nov 27, 2013 1:17 pm

Re: Check_HP plugin installation and use

Post 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.
/Luke
emislivec
Posts: 52
Joined: Tue Feb 25, 2014 10:06 am

Re: Check_HP plugin installation and use

Post 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.
szkoda
Posts: 42
Joined: Thu Dec 04, 2014 8:48 am

Re: Check_HP plugin installation and use

Post 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!
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Check_HP plugin installation and use

Post 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.
szkoda
Posts: 42
Joined: Thu Dec 04, 2014 8:48 am

Re: Check_HP plugin installation and use

Post 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?
Last edited by szkoda on Tue Dec 09, 2014 11:19 am, edited 2 times in total.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Check_HP plugin installation and use

Post 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.
szkoda
Posts: 42
Joined: Thu Dec 04, 2014 8:48 am

Re: Check_HP plugin installation and use

Post 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?
User avatar
lgroschen
Posts: 384
Joined: Wed Nov 27, 2013 1:17 pm

Re: Check_HP plugin installation and use

Post 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?
/Luke
szkoda
Posts: 42
Joined: Thu Dec 04, 2014 8:48 am

Re: Check_HP plugin installation and use

Post by szkoda »

Sorry typo, should be "nagios nagios"
Locked