I wrote a script to monitor my DB listener(as below), if the listener is down, send an email to me.
I am going to use the same way to monitor DB server process, such as "ora_smon_dev".
Does anyone has better idea to monitor your DB server and listener?
/bin/rm -f lsnr.exist
ps -ef | grep LISTENER | grep -v grep > lsnr.exist
if [ ! -s lsnr.exist ]
echo "." | mailx -s "ALERT!!! Oracle listener on `hostname` is down since `date`" email@example.com
We've talked about this a couple times on this forum. IMHO, monitoring each individual process does not give you adequate enough information to determine whether your database is accessible or not. For example, you may have a pmon process but your database is only in mount mode. All your background processes may be up, but your log_archive_dest is full.
I believe (as do several others) that the best way to monitor connectivity is to actually login to the database. If you login, great. If you can't, you get an error which will indicate what you should do.
To accomplish this task for my environment, I wrote a perl script that tries to login to the database. If I login, great, I just log out and go to sleep for N seconds. If I get an error, I know what to do about it. If the connection attempt takes longer than X seconds, I timeout and know what to do about it.
There is a plugin for the Nagios monitoring system that will attempt a dummy login. It uses a bogus name and password and returns 'OK' if the DB errors with access denied. Any other error indicates a problem.
Do you have features in your cellphones where the messages can be
textd or e-mailed and make your cell beep? Or you just log-in to ur
PC and check e-mail
Yep, we have a piece of software called Telalert that will send SMS or pages. Basically there is a standalone binary called telalertc that will send messages to the Telalert server which texts or pages. You can run telalertc from OS scripts or hook it up to Grid Control/OpenView or whatever.