Friday, February 14, 2014

Database | Filesystem | CPU Monitoring Script

I would like to share with you today the dbalarm.sh script. This script monitors FILESYSTEM usage, CPU overhead and report ORA- errors and TNS- errors on ALL databases & Listeners ALERTLOGs on the server.

This script is coded to send you the new errors that appear since the last run,
in other words, it will not report the errors been reported earlier unless they appear again in the logs, and this is one of the key strengths of that script.

The script has been tested on Linux and SUN environments.

How to use dbalarm script?
========================

This script is very smart and very easy to use, just follow these three steps:

Step 1:
Download the script from this link:

Step 2:
Open the script and change the E-mail address to your email address in the line# 16
MAIL_LIST="youremail@yourcompany.com"

Note: sendmail service should be configured and running on your server.

Step 3:
By Oracle user:
Schedule the execution of this script in the crontab at least every 5 minutes:
# crontab -e
#Add this line to schedule the run of dbalarm.sh script every 5minutes:
*/5 * * * * /home/oracle/dbalarm.sh
Note: /home/oracle/dbalarm.sh is the full path pointing to dbalarm script where /home/oracle is the Oracle user home directory.

In case you will schedule this script to run from root user crontab:
# crontab -e
#Add this line to schedule the run of dbalarm.sh script every 5minutes:
*/5 * * * * su - oracle -c /home/oracle/dbalarm.sh
Now the only thing remaining is to set back and relax and the script will send you the errors once it appear.

Also you can visit and download the whole DBA bundle that includes this script plus many other smart and easy to use scripts for database administration tasks:
http://dba-tips.blogspot.ae/2014/02/oracle-database-administration-scripts.html

DISCLAIMER: THIS SCRIPT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY WARRANTY. IT IS PROVIDED "AS IS".

In case the download link is not working, please find below the full code:



No comments: