Nagios not showing correct status

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
shuja_mca
Posts: 1
Joined: Fri Jan 08, 2016 1:00 pm

Nagios not showing correct status

Post by shuja_mca »

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
Last edited by hsmith on Fri Jan 08, 2016 1:11 pm, edited 1 time in total.
Reason: Please use the normal font size.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Nagios not showing correct status

Post by rkennedy »

If you run these commands over the CLI -

Code: Select all

export TNS_ADMIN=/apps/nagios/instantclient_11_2
echo "exit" | sqlplus -L test1/test1@facetst | grep Connected > /dev/null
echo $?
What is the output?
Former Nagios Employee
Locked