CentOS / RHEL 6 : How to change SNMP log level

The default options for snmpd daemon reside in /etc/sysconfig/snmpd file for RHEL 6. You can see the default options by running following command:

# grep OPTIONS /etc/init.d/snmpd

Modifying log levels for SNMP

1. In RHEL6, default configuration in /etc/sysconfig/snmpd for logging level of SNMP is:

# snmpd command line options
# OPTIONS="-LS0-6d -Lf /dev/null -p /var/run/snmpd.pid"

2. The mechanism and destination to use for logging of warning and error messages can be controlled by passing various parameters to the -L flag.

The various log levels available are :

0 or ! for LOG_EMERG
1 or a for LOG_ALERT
2 or c for LOG_CRIT
3 or e for LOG_ERR
4 or w for LOG_WARNING
5 or n for LOG_NOTICE
6 or i for LOG_INFO
7 or d for LOG_DEBUG

3. To reduce log level, “-LS0-6d” can be changed to “-LS0-5d” as shown below.

# snmpd command line options
# OPTIONS="-LS0-5d -Lf /dev/null -p /var/run/snmpd.pid"

4. To take effect, remove “#” and restart snmpd service.

# service snmpd restart
Related Post