Article Title: Prohibit snmpd from writing useless information to syslog. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
The system's snmp Service writes information to/var/log/messages files by default. For example:
Sep 20 09:50:50 localhost snmpd [23631]: Connection from UDP: [10.0.10.15]: 55399
Sep 20 09:50:50 localhost snmpd [23631]: Received SNMP packet (s) from UDP: [10.0.10.15]: 55399
Sep 20 09:50:50 localhost snmpd [23631]: Connection from UDP: [10.0.10.15]: 45631
Sep 20 09:50:50 localhost snmpd [23631]: Received SNMP packet (s) from UDP: [10.0.10.15]: 45631
To prevent unnecessary information from being written into log files, you can change the following files:
# Vi/etc/sysconfig/snmpd. options
# Snmpd command line options
# OPTIONS = "-Lsd-Lf/dev/null-p/var/run/snmpd. pid-"
The content of the preceding two rows is displayed.
OPTIONS = "-LS2d-Lf/dev/null-p/var/run/snmpd. pid-"
Restart the snmp service.