check_hp output null

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.
makgab
Posts: 15
Joined: Wed Jan 23, 2013 10:10 am

check_hp output null

Post 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.
Last edited by makgab on Wed Aug 28, 2013 3:20 am, edited 1 time in total.
makgab
Posts: 15
Joined: Wed Jan 23, 2013 10:10 am

Re: check_hp output null

Post by makgab »

The check_hp file is not for nagios. Need for example a shell script.
Can anyone send a script to it?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_hp output null

Post 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?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
makgab
Posts: 15
Joined: Wed Jan 23, 2013 10:10 am

Re: check_hp output null

Post 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?

:(
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: check_hp output null

Post by sreinhardt »

Most likely this is due to permissions on the file. Can you "ls -lva [path/to/file]"
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
makgab
Posts: 15
Joined: Wed Jan 23, 2013 10:10 am

Re: check_hp output null

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

Re: check_hp output null

Post 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.
makgab
Posts: 15
Joined: Wed Jan 23, 2013 10:10 am

Re: check_hp output null

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

Re: check_hp output null

Post 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?
makgab
Posts: 15
Joined: Wed Jan 23, 2013 10:10 am

Re: check_hp output null

Post 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
Locked