| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Script to be notified by email if db is down
Following is a simple one. It checks background process 'pmon' and
listener.
hjin
#!/bin/ksh
MAILLIST="xxx_at_xxx.com yyy_at_yyy.com"
# The final grep will return status = 0 if one or more matches are found
# First, check if database backgroud processes are running
ps -eo pid,args | grep -v grep | grep 'ora_pmon_SID' >/dev/null 2>&1
if [ $? -ne 0 ]
then
echo 'Oracle Database down for xxx!' | mailx -s "Your message" $MAILLIST fi
ps -eo pid,args | grep -v grep | grep 'tnslsnr' >/dev/null 2>&1
if [ $? -ne 0 ]
then
echo 'Oracle Listener down for xxx!' | mailx -s "Your message" $MAILLIST
fi
exit
Received on Fri Dec 28 2001 - 14:06:32 CST
![]() |
![]() |