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
Nagios not showing correct status
Nagios not showing correct status
Last edited by hsmith on Fri Jan 08, 2016 1:11 pm, edited 1 time in total.
Reason: Please use the normal font size.
Reason: Please use the normal font size.
Re: Nagios not showing correct status
If you run these commands over the CLI -
What is the output?
Code: Select all
export TNS_ADMIN=/apps/nagios/instantclient_11_2
echo "exit" | sqlplus -L test1/test1@facetst | grep Connected > /dev/null
echo $?
Former Nagios Employee