Useless SNMPD Logging Debian

THIS NO LONGER APPEARS TO WORK.

I found a blurb about ridding my logs of those useless “Connection from UDP” messages in my log files.
Why this isn’t the default I can only imagine (some will claim security I’m sure).

Snmpd filling up /var/log/messages

Here’s what I got out of it. That the below settings, added to /etc/default/snmpd will get rid of the useless messages but still log error messages.

SNMPDOPTS='-LS 0-4 d -Lf /dev/null -p /var/run/snmpd.pid'

I restarted snmpd and it seems to function as expected.

Here is what does work now since the Debian maintainer of snmpd is a fucking cunt. You have to change snmpd.service since this cockgobbler is ignoring all OPTS and hardcoding the command as seen below.

CUNT.

I should note that the proper way to do this is use overrides since the service file will be overwritten at boot.

root@TEST /etc # cat /lib/systemd/system/snmpd.service
[Unit]
Description=Simple Network Management Protocol (SNMP) Daemon.
After=network.target
ConditionPathExists=/etc/snmp/snmpd.conf

[Service]
Environment=”MIBSDIR=/usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/share/snmp/mibs/ietf:/usr/share/mibs/site:/usr/share/snmp/mibs:/usr/share/mibs/iana:/usr/share/mibs/ietf:/usr/share/mibs/netsnmp”
Environment=”MIBS=”
Type=simple
ExecStartPre=/bin/mkdir -p /var/run/agentx
ExecStart=/usr/sbin/snmpd -Lsd -Lf /dev/null -u Debian-snmp -g Debian-snmp -I -smux,mteTrigger,mteTriggerConf -f
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target

New:

root@TEST /etc # cat /lib/systemd/system/snmpd.service
[Unit]
Description=Simple Network Management Protocol (SNMP) Daemon.
After=network.target
ConditionPathExists=/etc/snmp/snmpd.conf

[Service]
Environment=”MIBSDIR=/usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/share/snmp/mibs/ietf:/usr/share/mibs/site:/usr/share/snmp/mibs:/usr/share/mibs/iana:/usr/share/mibs/ietf:/usr/share/mibs/netsnmp”
Environment=”MIBS=”
Type=simple
ExecStartPre=/bin/mkdir -p /var/run/agentx
ExecStart=/usr/sbin/snmpd -LS4d -Lf /dev/null -u Debian-snmp -g Debian-snmp -I -smux,mteTrigger,mteTriggerConf -f
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target

Hits: 2