Nagios not showing correct status
Posted: Fri Jan 08, 2016 1:08 pm
Hi Experts,
I want to check database status using asimple script. which is running well on the commnad prompt.
Below is the scripts.
#!/bin/sh
export TNS_ADMIN=/apps/nagios/instantclient_11_2
echo "exit" | sqlplus -L test1/test1@facetst | grep Connected > /dev/null
if [ $? -eq 0 ]
then
echo "OK"
exit 0
else
echo "NOT OK"
exit 2
fi
but the same script when i have used in nagios , it is always giving me " NOT OK".
Could you please help me urgently please
I want to check database status using asimple script. which is running well on the commnad prompt.
Below is the scripts.
#!/bin/sh
export TNS_ADMIN=/apps/nagios/instantclient_11_2
echo "exit" | sqlplus -L test1/test1@facetst | grep Connected > /dev/null
if [ $? -eq 0 ]
then
echo "OK"
exit 0
else
echo "NOT OK"
exit 2
fi
but the same script when i have used in nagios , it is always giving me " NOT OK".
Could you please help me urgently please