- Back to Home »
- AIX , Nagios »
- AIX上使用Nagios監控軟體接收SNMP的訊息,以IBM TS3100為例
1.在AIX編譯 SNMP 5.5 或是去找rpm安裝
./configure --disable-embedded-perl --without-kmem-usage
2.安裝SNMP (snmpd snmptrapd)
(1).安裝後設定設定檔 ./snmpconf -i
(2).IBM TS3100磁帶館預設snmp community是 public (initial),
3.安裝snmptt 以處理Trap後的Log
(1).snmptrapd.conf要加權限,並讓snmptt的Stand along和Daemon mod都能處理snmptrap的訊息
authCommunity log,execute,net public
traphandle default /usr/sbin/snmptthandler
traphandle default /usr/sbin/snmptt
重啟snmpd及snmptrapd
(2).snmptt 導入要監控的mib檔
./snmpttconvertmib --in=/usr/share/snmp/mibs/powernet361.mib --out=/etc/snmp/snmptt.ibm.conf
(3).vi snmptt.ini 將 snmptt.ibm.conf 加入
(4).要送訊息的部份加入submit_check_result HOSTNAME SERVICENAME CODE MESSAGE,範例如下
EVENT eventDoorOpen .1.3.6.1.4.1.2.6.210.4.2 "Status Events" INFORMATIONAL
FORMAT Library Door Opened: The library $1 (Serial Number $2) door has been opened.
EXEC /usr/local/nagios/libexec/eventhandlers/submit_check_result AS400-B0000 TS3100 1 "The library $1 (Serial Number $2) door has been opened"
SDESC
The library door has been opened.
Variables:
EDESC
(5).重啟snmptt服務,查log是否正確
(6).開TS 3100的Door或是Login/Logout Web帳號做測試.
Debug
1.有問的的話改snmpd.conf snmptrapd.conf snmptt.ini(debug=2),輸出log
2.AIX 開IIP trace,看該設備有沒有訊息到AIX
/usr/bin/startsrc -s iptrace -a "-a -b -d x.x.x.x -i en0 /var/log/snmptt/iptrace.cap" >/dev/null 2>&1
/usr/bin/stopsrc -s iptrace >/dev/null 2>&1
看trace log
ipreport -srn /var/log/snmptt/iptrace.cap
張貼留言