Nagios監控Oracle alert日誌指令碼

來源:互聯網
上載者:User

Nagios監控Oracle alert日誌指令碼

會點Nagios的知道怎麼用吧
#把nagios加入oinstall組
#usermod -a -G oinstall nagios

#! /bin/sh
dbversion=11
bdump=/u01/app/Oracle/oradata/PROD/dump/diag/rdbms/prod/PROD/trace/alert_PROD.log
STATE_OK=0
STATE_WARNING=1
STATE_CRITICAL=2
STATE_UNKNOWN=3
if [ $dbversion = 11 ]                                                                                         
then ins_log_pwd=$bdump
else
ins_log_pwd=$ORACLE_BASE/admin/$SERVICE_NAME/bdump/alert_$ORACLE_SID.log
fi
if [ `tail -50 $ins_log_pwd | grep 'ORA-' |grep -v -i -E '1013|1031|1144|1652|1722|8103|12012|3297|1410|2050|3113|3136|1555|1461|00600|1580|27054|6512' | wc -l` -gt 0 ];then
dmsgtmp=`tail -50 $ins_log_pwd | grep 'ORA-' |grep -v -i -E '1013|1031|1144|1652|1722|8103|12012|3297|1410|2050|3113|3136|1555|1461|00600|1580|27054|6512'`
echo "CRITICAL - $dmsgtmp"
echo "Oracle log result:" >> /home/nagios/alert.log
echo "  instance alert check result: $dmsgtmp " >> /home/nagios/alert.log
echo `date +%Y-%m-%d-%H:%M:%S` >> /home/nagios/alert.log
exit $STATE_CRITICAL
fi
if [ `tail -50 $ins_log_pwd | grep 'ORA-' |grep -v -i -E '1013|1031|1144|1652|1722|8103|12012|3297|1410|2050|3113|3136|1555|1461|00600|1580|27054|6512' | wc -l` -eq 0 ];then
echo "No error"
exit $STATE_OK
fi

錯誤對照:
ORA-1013:使用者請求取消當前的操作
ORA-1031:許可權不足
ORA-1144:檔案大小 ( 塊) 超出  塊的最大數
ORA-1652:無法通過(在資料表空間中)擴充 temp 段
ORA-1722:無效數字
ORA-8103:object no longer exists”
                    // *Cause: The object has been deleted by another user since the operation
                    // began, or a prior incomplete recovery restored the database to
                    // a point in time during the deletion of the object.
                    // *Action: Delete the object if this is the result of an incomplete
                    // recovery.
ORA-12012:error on auto execute of job 計劃任務執行失敗了
ORA-3297:file contains used data beyond requested RESIZE value
                    Cause:    Some portion of the file in the region to be trimmed is currently in use by a database object
                    Action:    Drop or move segments containing extents in this region prior to resizing the file, or choose a resize value such that only free space is in the trimmed.
ORA-1410:無效的 ROWID
ORA-2050:交易處理已重算,某些遠程 DBs 可能有問題
ORA-3113:
ORA-3136:inbound connection timed out
ORA-1555:快照過舊: 回退段號  在名稱為 "" 過小snapshot too old
ORA-1461:僅可以為插入 LONG 列的 LONG 值賦值
ORA-00600:死結
ORA-1580:建立控製備份檔案時出錯
ORA-27054:NFS file system where the file is created or resides is not mounted with correct options
ORA-6512:類似於這樣ORA-06512: at "SYS.DBMS_ISCHED", line 3761
                    ORA-06512: at "SYS.DBMS_ISCHED", line 772
                    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1236
                    ORA-06512: at line 2

網路監控器Nagios全攻略

Nagios搭建與配置詳解

Nginx環境下構建Nagios監控平台

在RHEL5.3上配置基本的Nagios系統(使用Nagios-3.1.2)

CentOS 5.5+Nginx+Nagios監控端和被控端安裝配置指南

Ubuntu 13.10 Server 安裝 Nagios Core 網路監控運用

Nagios 的詳細介紹:請點這裡
Nagios 的:請點這裡

本文永久更新連結地址:

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.