messages会有很多snmpd的信息,影响阅读正常信息
#tail /var/log/messages
- Jan 19 10:01:07 touran snmpd[4033]: Connection from UDP: [127.0.0.1]:5392
- Jan 19 10:01:07 touran last message repeated 10 times
- Jan 19 10:04:09 touran snmpd[4033]: Connection from UDP: [127.0.0.1]:5396
- Jan 19 10:04:09 touran snmpd[4033]: Received SNMP packet(s) from UDP: [127.0.0.1]:5396
- Jan 19 10:04:09 touran snmpd[4033]: Connection from UDP: [127.0.0.1]:5396
- Jan 19 10:06:07 touran last message repeated 11 times
- Jan 19 10:06:07 touran last message repeated 11 times
我们可以重新定义snmpd的日志输出级别来降低垃圾信息
我这里是centos的系统
#vi /etc/sysconfig/snmpd.options
修改为OPTIONS=”-LS3d -Lf /dev/null -p /var/run/snmpd.pid -a”
重启snmpd
#/etc/init.d/snmpd restart
详细的参数意思
可以用 man snmpd和man snmpcmd来查看
man snmpcmd中对日志等级的定义
0 or ! for LOG_EMERG,
1 or a for LOG_ALERT,
2 or c for LOG_CRIT,
3 or e for LOG_ERR,
4 or w for LOG_WARNING,
5 or n for LOG_NOTICE,
6 or i for LOG_INFO, and
7 or d for LOG_DEBUG.