Linux服务器可以很方便地开启snmpD监控,但是经常查看日志的管理员会发现,默认情况下/var/log/message中会生成大量的SNMPD的日志
Jan911:54:08isnmpd[2193]:ConnectionfromUDP:[60.195.249.83]:37412
Jan911:54:08isnmpd[2193]:ReceivedSNMPpacket(s)fromUDP:[60.195.249.83]:37412
Jan911:54:08isnmpd[2193]:ConnectionfromUDP:[60.195.249.83]:18749
Jan911:54:09isnmpd[2193]:ConnectionfromUDP:[60.195.249.83]:37412
Jan911:54:09isnmpd[2193]:ConnectionfromUDP:[60.195.249.83]:18749
Jan911:54:09isnmpd[2193]:ConnectionfromUDP:[60.195.249.83]:51089
Jan911:54:09isnmpd[2193]:ReceivedSNMPpacket(s)fromUDP:[60.195.249.83]:51089
Jan911:54:09isnmpd[2193]:ConnectionfromUDP:[60.195.249.83]:18749
Jan911:54:09isnmpd[2193]:ConnectionfromUDP:[60.195.249.83]:51089
Jan911:54:09isnmpd[2193]:ConnectionfromUDP:[60.195.249.83]:18749
无用的信息太多了。
不想看到这些多链接信息可以调整一下snmpd的debug级别:
#echo"OPTIONS=\"-LS3d-Lf/dev/null-p/var/run/snmpd.pid\"">>/etc/sysconfig/snmpd.options
或者直接改启动脚本
vi/etc/init.d/snmpd
找到这一项
OPTIONS="-Lsd-Lf/dev/null-p/var/run/snmpd.pid-a"
改为
OPTIONS="-LS3d-Lf/dev/null-p/var/run/snmpd.pid"
snmpd日志等级的定义:
0或!—-LOG_EMERG
1或a—-LOG_ALERT
2或c—-LOG_CRIT
3或e—-LOG_ERR
4或w—-LOG_WARNING
5或n—-LOG_NOTICE
6或i—-LOG_INFO
7或d—-LOG_DEBUG
最后别忘了重启服务
#servicesnmpdrestart