How to reduce SNMP logging on a Linux server

Background

SNMP is a wonderful tool but the moment you switch it on a Linux server you might find countless messages in your log file such as the following:

tail -f /var/log/messages

Oct 21 11:18:52 server snmpd[6404]: Connection from UDP: [a.b.c.d]:58212->[w.x.y.z]:161
Oct 21 11:18:56 server snmpd[6404]: Connection from UDP: [a.b.c.d]:65111->[w.x.y.z]:161
Oct 21 11:18:56 server snmpd[6404]: Connection from UDP: [a.b.c.d]:65112->[w.x.y.z]:161

Although these messages are completely harmless you probably want to suppress them so that you can focus on more important information in the logs.

How to reduce SNMP logging on a Linux Server

There are various remedies for turning off SNMP logging, some more complex than others. The one we found that works best is to add `dontLogTCPWrappersConnects yes` to your SNMPD configuration.

cat /etc/snmp/snmpd.conf

dontLogTCPWrappersConnects yes

Then restart snmp with service snmpd restart

For more remedies, see the reference below:

https://serverfault.com/questions/310640/reduce-snmpd-logging-verbosity

See Also

How to monitor Postfix queue length using an SNMP monitor

 

Share this article

2 thoughts on “How to reduce SNMP logging on a Linux server”

  1. shashikant sharma

    hi,
    Thank you very much for posting the information.
    I have one query about SNMP logging. Every time i make an SNMP query i see my SSH session Screen flooding with the
    Connection from UDP: [172.XX.XX.XX]:44313->[172.XX.XX.XY]:161
    Is there any way we can disable or hide them from SSH screen? Maybe can we keep capturing logs in the background?
    Thanks in advance.

    1. Eugène van der Merwe

      Hi there @shashikant

      Try adding `dontLogTCPWrappersConnects yes` to your snmpd.conf file, and then restart snmpd.

Leave a Reply

Your email address will not be published.

Scroll to Top