歸檔告警頻繁監控指令碼

hurp_oracle發表於2015-08-11
歸檔監控指令碼做了一下改動,發現的告警資訊如下:
c4oyy1a:150811_23:01:24 Warning: 歸檔目錄/arch1:78%每10分種歸檔 21次,告警閥值20,請注意!

指令碼:db_monitor.conf 增加內容
###歸檔頻繁監控 
ARCHIVED_COUNT_MON=Y 
ARCHIVED_COUNT_ALERT=20 
ARCHIVED_ALERT=70 
指令碼:db_monitor_sda.sh  增加內容
############## 歸檔頻率監控 ################### 
if [ "X${ARCHIVED_COUNT_MON}" = "XY" ]; then 
DATE="`hostname`:`date +%y%m%d_%H:%M:%S` Warning: " 
ARC_COUNT=`$ORACLE_HOME/bin/sqlplus -S / as sysdba <<EOF 
set line 200 
SET PAGES 0 FEEDBACK OFF VERIFY OFF HEADING OFF ECHO OFF 
select count(*) from v\\\$archived_log where COMPLETION_TIME between sysdate-10/1440 and sysdate and thread#=SYS_CONTEXT('USERENV', 'INSTANCE') 
having count(*) >${ARCHIVED_COUNT_ALERT}; 
EOF` 
ARC_CATALOG=`$ORACLE_HOME/bin/sqlplus -S / as sysdba <<EOF 
set line 200 
SET PAGES 0 FEEDBACK OFF VERIFY OFF HEADING OFF ECHO OFF 
select substr(value,10) from v\\\$parameter where name='log_archive_dest_1'; 
EOF` 

SMS_INFO=`df -g |grep -e ${ARC_CATALOG} | awk -F"[ ]*|%" '{if ($4 > '${ARCHIVED_ALERT}'){print $NF ":" $4}}'` 
if [ "$SMS_INFO" != "" ] && [ "$ARC_COUNT" != "" ]; then 
echo "${DATE}歸檔目錄${SMS_INFO}%每10分種歸檔${ARC_COUNT}次,告警閥值${ARCHIVED_COUNT_ALERT},請注意!"> $TEMPLOG 
TEMP=`cat $TEMPLOG` 
smswarn $HAND $TEMP 
cat $TEMPLOG >>$ALERTLOG 
fi 
fi

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29446986/viewspace-1768750/,如需轉載,請註明出處,否則將追究法律責任。

相關文章