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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • 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. “Abort command issued nexus” error messages in /var/log/messages file
  2. Example of using getnstimeofday in Linux kernel
  3. ‘ip’ Command cheat sheet (Command Line Reference)
  4. How to Disable IPv6 on Ubuntu 18.04 Bionic Beaver Linux
  5. Linux Command line Basics – Working with Files and Directories
  6. How to install and Configure VNC (TigerVNC) server in CentOS / RHEL 7
  7. groupmems Command Examples in Linux
  8. Extend volume on non-partitioned disk (XFS) under VMware guest
  9. How to Find and Delete Empty Directories and Files in Linux
  10. Working with Vim editor (Text Editor)

You May Also Like

Primary Sidebar

Recent Posts

  • grpck command – Remove corrupt or duplicate entries in the /etc/group and /etc/gshadow files.
  • xxd command – Expressed in hexadecimal form
  • sesearch: command not found
  • macof: command not found

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright