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
- WAS CANCELLED BY =======:
Path: news.sol.net!spool0-nwblwi.newsops.execpc.com!newsfeeds.sol.net!news-out.visi.com!hermes.visi.com!uunet!ash.uu.net!sac.uu.net!lax.uu.net!news.navix.net!u-n-c-a-n-c-e-l-l-e-r
From: hhjin_at_yahoo.com (Helen)
Newsgroups: alt.config,comp.lang.c,comp.databases.oracle.server
Subject: cmsg cancel <ebcac1e2.0112281206.10bfdec0_at_posting.google.com>
Control: cancel <ebcac1e2.0112281206.10bfdec0_at_posting.google.com>
Date: Mon, 31 Dec 2001 05:23:47 GMT
Organization: Navix Internet Subscribers
Lines: 2
Message-ID: <cancel.ebcac1e2.0112281206.10bfdec0_at_posting.google.com>
NNTP-Posting-Host: 166.102.15.34
X-Trace: iac5.navix.net 1009790022 28060 166.102.15.34 (31 Dec 2001 09:13:42 GMT)
X-Complaints-To: abuse_at_navix.net
NNTP-Posting-Date: 31 Dec 2001 09:13:42 GMT
X-No-Archive: yes
Comment: Anarchy! Fuck You!
X-Commentary: I love NewsAgent 1.10, Sandblaster Build 74 (19 March 1999) and the Polaris Cancel Engine V. 6.1
X-Unacanc3l: yes
This message was cancelled from within Mozilla...not
Received on Fri Dec 28 2001 - 14:06:32 CST