I have written a bash script such as follow :
Actually want if in result.txt file find open show ok , otherwise show critical . now want to know how can use this for my host ?
HTML Code:
#!/bin/bash
cd /home/oracle ; . db-env; sqlplus / as sysdba << EOF >/dev/null
@/home/oracle/backupscript/startup.sql
spool /home/oracle/backupscript/result.txt
@/home/oracle/backupscript/select.sql
EOF
sleep 40
if [ `grep -i OPEN /home/oracle/backupscript/result.txt` == "OPEN" ]
then
sleep 40
exit 0
else
exit 1
fi
Actually want if in result.txt file find open show ok , otherwise show critical . now want to know how can use this for my host ?
Comment