#!/bin/bash
# This script is to send mail for alerting ALERT LOG Monitoring
# Assumption smtb confirgured,created DIR's
# Note : you have to have SSH connectivity between monitoring server and the db server,Enter the ALERT log details in alertfile_detail.txt:
as format "+ASM1 10.95.10.101 oracle /u01/app/oracle/diag/asm/+asm/+ASM1/trace/alert_+ASM1.log"
WORK_DIR=/u01/app/oracle/util/scripts
LOG_DIR=/u01/app/oracle/util/log
log_file=/u01/app/oracle/util/scripts/alertfile_detail.txt
file_header=$WORK_DIR/alert_header.log
temp_file=$WORK_DIR/alert_report_temp.log
final_report=$WORK_DIR/alertlog_full_report.html
export PATH=$PATH:/usr/sbin
CURR_DATE=`date '+%m/%d/%y_%H:%M'`
if [ -e $temp_file ]
then
`rm $temp_file `
fi
if [ -e $final_report ]
then
`rm $final_report `
fi
if [ -e $file_header ]
then
`rm $file_header `
fi
touch $file_header
echo $CURR_DATE
html_head="Subject: Alert log report for ${CURR_DATE}
\nMIME-Version: 1.0 \nContent-Type: text/html \nContent-Disposition: inline \n
<html>
<head>
<meta http-equiv=\"Content-Type\" content=text/html;
# This script is to send mail for alerting ALERT LOG Monitoring
# Assumption smtb confirgured,created DIR's
# Note : you have to have SSH connectivity between monitoring server and the db server,Enter the ALERT log details in alertfile_detail.txt:
as format "+ASM1 10.95.10.101 oracle /u01/app/oracle/diag/asm/+asm/+ASM1/trace/alert_+ASM1.log"
WORK_DIR=/u01/app/oracle/util/scripts
LOG_DIR=/u01/app/oracle/util/log
log_file=/u01/app/oracle/util/scripts/alertfile_detail.txt
file_header=$WORK_DIR/alert_header.log
temp_file=$WORK_DIR/alert_report_temp.log
final_report=$WORK_DIR/alertlog_full_report.html
export PATH=$PATH:/usr/sbin
CURR_DATE=`date '+%m/%d/%y_%H:%M'`
if [ -e $temp_file ]
then
`rm $temp_file `
fi
if [ -e $final_report ]
then
`rm $final_report `
fi
if [ -e $file_header ]
then
`rm $file_header `
fi
touch $file_header
echo $CURR_DATE
html_head="Subject: Alert log report for ${CURR_DATE}
\nMIME-Version: 1.0 \nContent-Type: text/html \nContent-Disposition: inline \n
<html>
<head>
<meta http-equiv=\"Content-Type\" content=text/html;