Page 1 of 2
check_hp output null
Posted: Wed Aug 14, 2013 6:25 am
by makgab
Hi!
I try it:
http://exchange.nagios.org/directory/Pl ... hp/details
In command line is okay: "Compaq/HP Agent Check: overall system state OK"
But in nagios output: (null)
Code: Select all
define command {
command_name check_hp
command_line $USER1$/check_hp -H $HOSTADDRESS$ -C public -v 2
}
define service {
use generic-service
host_name hp_proliant
service_description HP STATUS
check_command check_hp
}
What is wrong?
G.
Re: check_hp output null
Posted: Wed Aug 14, 2013 9:34 am
by makgab
The check_hp file is not for nagios. Need for example a shell script.
Can anyone send a script to it?
Re: check_hp output null
Posted: Wed Aug 14, 2013 10:30 am
by abrist
So, the following command works from the cli:
Code: Select all
/usr/local/nagios/libexec/check_hp -H <Hostaddress> -C public -v 2
Correct?
Have you attempted to run the command from the cli as user "nagios", or just as root?
Re: check_hp output null
Posted: Thu Aug 15, 2013 1:26 am
by makgab
I tried to run as nagios user:
Code: Select all
sudo -u nagios ./check_hp -H 10.10.10.115 -C public -v 2
Then it was correctly. I got the response from HP server.
In Webinterface output: (null)
Why is it?

Re: check_hp output null
Posted: Thu Aug 15, 2013 10:05 am
by sreinhardt
Most likely this is due to permissions on the file. Can you "ls -lva [path/to/file]"
Re: check_hp output null
Posted: Fri Aug 16, 2013 5:28 am
by makgab
the file permission:
Code: Select all
/usr/lib/nagios/plugins/check_hp rwxrwxr-x root root
Do I try to set it to nagios.nagios?
(I will try it...)
Re: check_hp output null
Posted: Fri Aug 16, 2013 12:41 pm
by slansing
Try nagios.apache, if that does not work, try nagios.nagios. It should not be root.root as the web interface will not execute it as root.
Re: check_hp output null
Posted: Tue Aug 27, 2013 8:58 am
by makgab
slansing wrote:Try nagios.apache, if that does not work, try nagios.nagios. It should not be root.root as the web interface will not execute it as root.
It doesn't work.

Same... output: (null)
Re: check_hp output null
Posted: Tue Aug 27, 2013 10:44 am
by slansing
Can you "su" to the nagios user and try executing the plugin from the command line with the values you would be using for the check?
Re: check_hp output null
Posted: Wed Aug 28, 2013 1:30 am
by makgab
slansing wrote:Can you "su" to the nagios user and try executing the plugin from the command line with the values you would be using for the check?
Code: Select all
# su - nagios
This account is currently not available.
Because nagios has nologin by default.
But it gets output, it works in command line:
Code: Select all
sudo -u nagios ./check_hp -H 10.10.10.114 -C public -v 2