Suppress massively SNMP notices in message log

In my CentOS, with SNMP, it arise much more SNMP logs in message periodically. Like this:

Connection from UDP: []:xxxxx
Received SNMP packet(s) from UDP: []:xxxxx

Although the notices are harmless, it may drown out other useful messages. To suppress these messages, we can modify the parameters passed to SNMP daemon.

There is a default configuration in /etc/sysconfig/snmpd.options with a comment out option line:

# OPTIONS=”-Lsd -Lf /dev/null -p /var/run/ -a”

This line indicate SNMP’s log facility via syslog is for daemon (-Lsd) and it will log all levels (there are 7 levels). To suppress the notices, the configuration is modified as:

OPTIONS="-LS0-4d -Lf /dev/null -p /var/run/ -a"

. The parameter -LS is to specify the level we want to log, and we set level 0 to 4 (emergency, alert, critical, error, warning) for it. Whereas the level 5 is for notice, 6 for info and 7 for debug are not what we need.

Finally, the log is clearly as usual. 😛

Leave a Reply

Your email address will not be published. Required fields are marked *