消除linux log中的大量Received SNMP packet(s) from UDP

tolywang發表於2010-02-24
redhat 5.2 調整snmp debug級別
在用redhat linux 5.2版本後,有一個問題就是有很多snmpd log資訊記錄在/var/log/messages裡,在4u4裡是不記錄的,導致messages產生大量的重複資訊,好多有用的資訊很快就會被淹沒,這裡透過調整snmp debug級別解決這個問題
/var/log/message 如:
Feb 17 16:00:07 db3 last message repeated 2 times
Feb 17 16:05:02 db3 snmpd[5479]: Connection from UDP: [119.42.224.21]:48750
Feb 17 16:05:02 db3 snmpd[5479]: Received SNMP packet(s) from UDP: [119.42.224.21]:48750
Feb 17 16:05:02 db3 snmpd[5479]: Connection from UDP: [119.42.224.21]:48750
Feb 17 16:05:02 db3 snmpd[5479]: Connection from UDP: [119.42.224.21]:48750
Feb 17 16:05:07 db3 snmpd[5479]: Connection from UDP: [119.42.224.28]:53640
Feb 17 16:05:07 db3 snmpd[5479]: Received SNMP packet(s) from UDP: [119.42.224.28]:53640
Feb 17 16:05:07 db3 snmpd[5479]: Connection from UDP: [119.42.224.28]:53640
Feb 17 16:05:07 db3 last message repeated 2 times
Feb 17 16:10:01 db3 snmpd[5479]: Connection from UDP: [119.42.224.21]:48765
Feb 17 16:10:01 db3 snmpd[5479]: Received SNMP packet(s) from UDP: [119.42.224.21]:48765
Feb 17 16:10:01 db3 snmpd[5479]: Connection from UDP: [119.42.224.21]:48765
Feb 17 16:10:01 db3 snmpd[5479]: Connection from UDP: [119.42.224.21]:48765
Feb 17 16:10:21 db3 snmpd[5479]: Connection from UDP: [119.42.224.28]:54506
Feb 17 16:10:21 db3 snmpd[5479]: Received SNMP packet(s) from UDP: [119.42.224.28]:54506
Feb 17 16:10:21 db3 snmpd[5479]: Connection from UDP: [119.42.224.28]:54506
解決方法:
編輯/etc/init.d/snmpd
把:
OPTIONS="-Lsd -Lf /dev/null -p /var/run/snmpd.pid -a"
修改成:
OPTIONS="-LS 0-4 d -Lf /dev/null -p /var/run/snmpd.pid -a"
然後/etc/rc.d/init.d/snmpd restart 重啟snmp即可
 
作者:george.ma blog:http://blog.chinaunix.net/u/12521/

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

相關文章