Stop snmpd spamming messages in centos 7

SNMPD spamming /var/log/messages is a pet hate of mine. It causes so much rubbish to be sat in the logs. I had a hard time looking for how to do this on centos 7. I eventually managed to work it so im adding it here as i wasnt able to find the relevant resource online.

CD into the relevant directory

[root@home-server ~]# cd /etc/systemd/system/
[root@home-server]# vi snmpd.service

Change the Environment variable as so:


Close vi

Restart the service

[root@home-server]# systemctl restart snmpd.service

Say good bye to all these messages!

Apr 19 03:25:41 home-server snmpd[980]: Connection from UDP: [192.168.*.*]:39604->[192.168.*.*]:161