incorrect output
Posted: Fri Nov 21, 2014 8:44 am
Hi All,
I have one shell script, using to check two process running or not.
When i run that script on client it gives correct output (process running or not) but while running plugins from nagios server its gives opposite out-put.
Below is script :
cat check_consum_process
#!/bin/sh
#set -x
COUNT2=`ps -aef | grep -v grep | egrep 'AB.py |XX.py' | wc -l`
if
[ $COUNT2 -eq 2 ]
then
echo "AB.py/XX.py OK"
exit 0
else
echo "AB.py/XX.py NOT OK"
exit 2
fi
OUTPUT on client end.
Command :: ./check_consum_process
OUTPUT :: AB.py/XX.py OK
OUTPUT from nagios server :
command :: /usr/lib/nagios/plugins/check_nrpe -H ABC_server -c check_custom_consum_process
Output :: AB.py/XX.py NOT OK
Don't know whats going wrong here..
Nagios Version 3.2.1
Please help.
I have one shell script, using to check two process running or not.
When i run that script on client it gives correct output (process running or not) but while running plugins from nagios server its gives opposite out-put.
Below is script :
cat check_consum_process
#!/bin/sh
#set -x
COUNT2=`ps -aef | grep -v grep | egrep 'AB.py |XX.py' | wc -l`
if
[ $COUNT2 -eq 2 ]
then
echo "AB.py/XX.py OK"
exit 0
else
echo "AB.py/XX.py NOT OK"
exit 2
fi
OUTPUT on client end.
Command :: ./check_consum_process
OUTPUT :: AB.py/XX.py OK
OUTPUT from nagios server :
command :: /usr/lib/nagios/plugins/check_nrpe -H ABC_server -c check_custom_consum_process
Output :: AB.py/XX.py NOT OK
Don't know whats going wrong here..
Nagios Version 3.2.1
Please help.