This script was made to monitor errors on oracle alert log.
This script just look on alert log of eache instance monitor and if find an error send an appropriate email, with the error in attach.
To install this script add in /etc/fstab one line like thisone:
//<SERVERNAME>.<DOMAIN>/c$/oracle/product/10.2.0/admin /mnt/oracle/<SERVERNAME> cifs domain=<DOMAIN>,user=<USERNAME>,pass=<PASSWORD>,ro
With this i suppose that oracle run on Windows server and the monitoring script on a linux machine. Otherwise if you run Oracle inside a Linux server you need mount locally the location that contain the alertlog file.
and run this script as:
/opt/oralog_analyzer/analyzer.sh <INSTANCENAME> <INSTANCENAME> /mnt/oracle/<SERVERNAME>/<INSTANCENAME>/bdump/alert_<INSTANCENAME>.log
Is fundamental that this script run with a fully qualified path because he get his own configuration parameter on cfg/global file that is included.
As you can see in this file you are going to find:
#GLOBAL CONFIGURATION FILE
#To send email SENDMAIL=[yes|no]
#Specify mail address
#To send to zabbix_server SENDZABBIX=[yes|no]
#full path for mutt
#Configure Zabbix Sender
#NOTIFY[HIGH|WARNING|INFO|AVERAGE]= [yes|no] to notify every level
#if you want receive anyway email for each level
in each file contained inside cfg you will find the error-list that is trapped by this script.
to run this script after configured email address
add a line like thisone in crontab
# check log oracle
*/10 * * * * /opt/oralog_analyzer/analyze_log.sh
so every 10 minutes the script is executed
the home of this project is:
i’ve called this project just loganalyzer because now is ready to monitor Oracle alert log, but is really easy to modify to check other kind of log
Tags: database, linkedin, monitor, oracle, script, shell