Jasmin shahrzad
asked on
nrpe unable to read output
i have a very little script which is running when i use $ ./check_dock
docker -com.... ok cpuuerc 0.xx%
when i used in $ ./check_nrp -H "ip/localhost/127.0.0.1" -c check_dock
return: NRPE: Unable to read output
all other command i defined in nrpe is running.
What i missing here?
my check_dock scripts is:
-------
#!/bin/bash -el
#
#
#
# Author: Bahman Sharzad
# Mail: bshmsn.sharzad@process-fac tory.dk
SUDO=/usr/bin/sudo
alias direc="cd /usr/local/nagios/libexec"
# . check docker container
ERROR_CODE1=-1
statu=$((sudo /usr/local/nagios/libexec/ check_dock er -n $1 -c 80,90) | awk '{print $2}')
#echo $statu
all=$(sudo /usr/local/nagios/libexec/ check_dock er -n $1 -c 80,90)
#echo $all
if [ $statu = 'WARN' ]; then
echo $all
ERROR_CODE1=1
elif [ $statu = 'CRIT' ]; then
echo $all
ERROR_CODE1=2
elif [ $statu = 'OK' ]; then
echo $all
ERROR_CODE1=0
fi
exit $ERROR_CODE1
------
and command in nrpe is
--
command[check_dock]=/usr/l ocal/nagio s/libexec/ check_dock docker-compose_mongodb_1
---
i run command : $ sudo ./check_nrpe -H 127.0.0.1 -c check_dock
NRPE: Unable to read output
docker -com.... ok cpuuerc 0.xx%
when i used in $ ./check_nrp -H "ip/localhost/127.0.0.1" -c check_dock
return: NRPE: Unable to read output
all other command i defined in nrpe is running.
What i missing here?
my check_dock scripts is:
-------
#!/bin/bash -el
#
#
#
# Author: Bahman Sharzad
# Mail: bshmsn.sharzad@process-fac
SUDO=/usr/bin/sudo
alias direc="cd /usr/local/nagios/libexec"
# . check docker container
ERROR_CODE1=-1
statu=$((sudo /usr/local/nagios/libexec/
#echo $statu
all=$(sudo /usr/local/nagios/libexec/
#echo $all
if [ $statu = 'WARN' ]; then
echo $all
ERROR_CODE1=1
elif [ $statu = 'CRIT' ]; then
echo $all
ERROR_CODE1=2
elif [ $statu = 'OK' ]; then
echo $all
ERROR_CODE1=0
fi
exit $ERROR_CODE1
------
and command in nrpe is
--
command[check_dock]=/usr/l
---
i run command : $ sudo ./check_nrpe -H 127.0.0.1 -c check_dock
NRPE: Unable to read output
ASKER
Yes yes. nrpe is install for a long time ago and i check status as cpu, disk, memory oracle,.... .
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Issue is solved. problem was in my code. it was a wrong else after my if.
Looks like on the remote host, NRPE is not installed, or it is not installed correctly.