Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Performance

Reduce SNMPd Logging Level

Submitted by on September 8, 2015 – 11:01 am

By default, (on RHEL/CentOS, at least) snmpd will log all connection attempts, which can turn your /var/log/messages into a giant mess, looking something like this…

Sep  8 10:26:00 deathstar snmpd[25387]: Connection from UDP: [192.168.12.32]:35794->[192.168.23.54]
Sep  8 10:26:00 deathstar snmpd[25387]: Connection from UDP: [192.168.12.32]:35794->[192.168.23.54]
Sep  8 10:26:00 deathstar snmpd[25387]: Connection from UDP: [192.168.12.32]:35794->[192.168.23.54]
Sep  8 10:26:00 deathstar snmpd[25387]: Connection from UDP: [192.168.12.32]:35794->[192.168.23.54]
Sep  8 10:26:00 deathstar snmpd[25387]: Connection from UDP: [192.168.12.32]:35794->[192.168.23.54]

The entries are repetitive and, in most cases, are of no value. They simply tell you that some server out there has tried to connect to the SNMP service. With a large number of incoming connections, much of your server’s resources may be wasted on logging this useless data.

Since the net-snmp v 5.3, you have the ability to disable this particular log message. Below if a quick overview tested on RHEL 6.3.

Update net-snmp:

yum -y update net-snmp

Update /etc/snmp/snmpd.conf
cat << EOF >> /etc/snmp/snmpd.conf
dontLogTCPWrappersConnects 1
EOF

Update /etc/sysconfig/snmpd (see note below)
cat << EOF >> /etc/sysconfig/snmpd
OPTIONS="-Lsd -Lf /dev/null -p /var/run/snmpd.pid"
EOF

Restart snmpd
/sbin/service snmpd restart

Note: you may need to edit either /etc/sysconfig/snmpd or /etc/sysconfig/snmpd.options. Check /etc/init.d/snmpd for the following “if” statement to figure out which file to edit (or create):
if [ -e /etc/sysconfig/snmpd ]; then
  . /etc/sysconfig/snmpd
fi

 

Print Friendly, PDF & Email

Leave a Reply