Re: NRPE: unable to read output.
Posted: Thu Jun 07, 2018 10:17 am
As you have suggested I added echo $pid in my check_node script but same thing not getting any output.
I restarted nrpe service also after making the changes in the script
I tried with this command also but doesn't help.
I restarted nrpe service also after making the changes in the script
Code: Select all
#!/bin/bash
#Mentioned valid service name
service=node
#Checking for service pid value
pid=`ps -ef | grep -v grep | grep -i $service | wc -l`
case $pid in
[2]*)
echo $pid
echo "OK - $service is running"
exit 0
;;
[0]*)
echo $pid
echo "CRITICAL -$service is not running"
exit 2
;;
[1]*)
echo $pid
echo "WARNING -$service Please check the service"
exit 1
;;
esac
Code: Select all
sudo su nagios -c /usr/local/nagios/libexec/node_check