NRPE unable to read output
Posted: Wed Jan 18, 2012 4:52 am
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:
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?
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
Also debug mode doesn't give any extra output.
Can anyone tell what is happening here?