Rights problem: "ERROR: No parseable output"

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.
Locked
Tazzy
Posts: 2
Joined: Thu Jun 20, 2013 4:04 am

Rights problem: "ERROR: No parseable output"

Post by Tazzy »

Hello all,

i've got a problem with my Nagios Core 3.4.4
I've downloaded a script to check the ILO hardware of our HP servers.
When I run the command as root everthing runs fine.

Code: Select all

./check_ilo2_health.pl -H 10.0.10.8 -u USER -p PASSWORD -3 -n
Gives back:

Code: Select all

ILO2_HEALTH OK - (Board-Version: ILO>=3)
So far so good...

But when I run the script in my Nagios config

Code: Select all

# ESX CHECK HP Hardware
define command{
command_name    check-esx-hp-hardware
command_line    $USER1$/check_ilo2_health.pl -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -3 -n
}
The output is "ILO2_HEALTH UNKNOWN - ERROR: No parseable output."

So my guess is that the user nagios doesn't have the rights to run this script.
Anyone knows how to further troubleshoot and solve this problem?

Thnx a lot!

Tazzy
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Rights problem: "ERROR: No parseable output"

Post by abrist »

Tazzy wrote:So my guess is that the user nagios doesn't have the rights to run this script.
To test this, switch user to "nagios" and then run you check:

Code: Select all

su nagios
./check_ilo2_health.pl -H 10.0.10.8 -u USER -p PASSWORD -3 -n
Also, what are the file permissions?

Code: Select all

ls -la /usr/local/nagios/libexec/check_ilo2_health.pl
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.
Tazzy
Posts: 2
Joined: Thu Jun 20, 2013 4:04 am

Re: Rights problem: "ERROR: No parseable output"

Post by Tazzy »

Hey,

thnx for the reply.
This is the output:

Code: Select all

[root@srv-nagios ~]# su nagios
bash-4.1$ ./check_ilo2_health.pl -H 10.0.10.8 -u USER -p PASSWORD -3 -n
bash: ./check_ilo2_health.pl: Permission denied
bash-4.1$ ls
ls: cannot open directory .: Permission denied
bash-4.1$ cd /usr/
bin/     games/   lib/     libexec/ sbin/    src/
etc/     include/ lib64/   local/   share/   tmp/
bash-4.1$
bash-4.1$
bash-4.1$ cd /usr/lib64/nagios/plugins/
bash-4.1$ ./check_ilo2_health.pl -H 10.0.10.8 -u USER -p PASSWORD -3 -n
ILO2_HEALTH OK - (Board-Version: ILO>=3)
bash-4.1$
Could it be that this is the problem?

Code: Select all

bash: ./check_ilo2_health.pl: Permission denied
My /etc/passwd looks like this:

Code: Select all

root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
gopher:x:13:30:gopher:/var/gopher:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:99:99:Nobody:/:/sbin/nologin
vcsa:x:69:69:virtual console memory owner:/dev:/sbin/nologin
rpc:x:32:32:Rpcbind Daemon:/var/cache/rpcbind:/sbin/nologin
rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
ntp:x:38:38::/etc/ntp:/sbin/nologin
nagios:x:499:498::/var/spool/nagios:/bin/bash
apache:x:48:48:Apache:/var/www:/sbin/nologin
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Rights problem: "ERROR: No parseable output"

Post by abrist »

You must be on ubuntu or some other debian derivative as the paths I gave you in the previous commands were wrong for your distro. Try these commands:

Code: Select all

su nagios
cd /usr/lib64/nagios/plugins/
./check_ilo2_health.pl -H 10.0.10.8 -u USER -p PASSWORD -3 -n
ls -la /usr/lib64/nagios/plugins/check_ilo2_health.pl
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.
Locked