• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

CentOS / RHEL 6 : How to change SNMP log level

By admin

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

Filed Under: Linux

Some more articles you might also be interested in …

  1. How the BASH Shell load its configuration files in Linux
  2. How to Enable X11 Forwarding on CentOS/RHEL 5,6,7
  3. How to Rebuild GRUB on MSDOS Partition Type in CentOS/RHEL/OEL 7
  4. How to modify snmp service to listen to an alternative port in CentOS/RHEL
  5. CentOS / RHEL : How to configure vsftpd to use ports other than the default ports 20 and 21
  6. Linux / UNIX : How to find files which has SUID/SGID set
  7. CentOS / RHEL 5, 6 : how to disable NetworkManager
  8. How to Check whether SELinux is Enabled or Disabled
  9. How to Partition DM-Multipath Pseudo Devices in CentOS/RHEL
  10. How to Configure SSH to restrict Users/Groups with allow and deny directives

You May Also Like

Primary Sidebar

Recent Posts

  • Failed to start LSB: Bring up/down networking – On restarting network service CentOS/RHEL (DHCP client)
  • How To Add Timestamps To dmesg Kernel Boot Log in CentOS/RHEL
  • How to disable ICMP redirects on CentOS/RHEL
  • What are Oracle Key Vault Roles
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary