NRPE unable to read 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
patrick2011
Posts: 6
Joined: Tue Jan 10, 2012 4:43 am

NRPE unable to read output

Post by patrick2011 »

Hi,

When I run a script local, the script is working fine but when I run it with check_nrpe on the nagios server i'll get "NRPE: unable to read output"

The script:

Code: Select all

/usr/sbin/zoneadm list -ip > /tmp/zoneinfo
msg=

cat /tmp/zoneinfo | while read info
do
zone=`echo $info | cut -d : -f 2`
state=`echo $info | cut -d : -f 3`
if [ "$state" = "running" ]; then
        msg="OK: zone $zone is in running state "
else
        msg="CRITICAL: Zone $zone is in $state "
        $status = 2
fi
echo $msg
done

if [ "$status" = "2" ]; then
        sort $msg
        exit 2
fi
rm /tmp/zoneinfo
exit 0
So, when I use "/usr/bin/zoneadm list -ip" is fails, but when I change this command to e.g. "/usr/bin/ls -la /tmp" I get output from check_nrpe on the nagios server.
Also debug mode doesn't give any extra output.

Can anyone tell what is happening here?
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: NRPE unable to read output

Post by jsmurphy »

Are you able to post the relevant piece of your nrpe config for executing the script?

You may also want to check that the user that the nrpe client runs as (usually nagios) has sufficient privileges to execute the script correctly.
patrick2011
Posts: 6
Joined: Tue Jan 10, 2012 4:43 am

Re: NRPE unable to read output

Post by patrick2011 »

Hi,

When I didn't have the sufficient privileges to execute the script it would give me any output.
It gives me output with "ls -la" but not with "zoneadm"

The problem was an update of the libs on the server.
It gave an segv on zoneadm.

So problem is solved.
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: NRPE unable to read output

Post by jsmurphy »

Glad you solved the issue.
Locked