shell script to check the lsitener [message #301096] |
Tue, 19 February 2008 03:30 |
daniesh.shaikh@gmail.com
Messages: 62 Registered: February 2008 Location: india
|
Member |
|
|
Hi gurus,
I am writing a script for one of the clients.
i got stuck could anybody help me out.
dbalist="daniesh.shaikh@gmail.com";export dbalist
ps -ef|grep pmon >database.txt
if (grep "PROD" database.txt)
then
touch "no file"
else
echo "database is down"| mailx -s $dbalist
fi
i am getting an error. i am not getting my mail to my id.
i am redirecting the o/p of ps -ef|grep to database.txt
then alse the o/p of that command get displayed on my screen
i want only database is down to my id .
could anyone explain me the better way to write the script.
Thanks,
Daniesh
|
|
|
|
Re: shell script to check the lsitener [message #301109 is a reply to message #301096] |
Tue, 19 February 2008 03:50 |
|
Mahesh Rajendran
Messages: 10708 Registered: March 2002 Location: oracleDocoVille
|
Senior Member Account Moderator |
|
|
To add,
the topic says
>>shell script to check the lsitener
But you are looking at pmon.
Looking into smon/pmon to check the availability of database is flawed. The Instance can be up and still database could be down.
|
|
|