UbuntuServer prohibits SNMPD from writing logs to syslog

Source: Internet
Author: User
The company uses javastuserver, which uses cacti for monitoring through the SNMPD Protocol. However, when viewing system logs, snmpd generates a large number of logs, sometimes turning over many screens, to see the system information. This is a nightmare for administrators who want to view system logs every day. By using the following method, you can disable snmpd to write logs to the system log file. In this way, the system log looks much simpler than root @ ubuntu :~ # Vim/et

The company uses Ubuntu Server and cacti for monitoring through the SNMPD Protocol. However, when viewing system logs, snmpd generates a large number of logs, sometimes you need to flip a lot of screens to see the system information. This is a nightmare for administrators who want to view system logs every day. By using the following method, you can disable snmpd to write logs into the system log file, so that the system log looks much simpler.

  1. Root @ ubuntu :~ # Vim/etc/default/snmp
  2.  
  3. # This file controls the activity of snmpd and snmptrapd
  4.  
  5. # Don't load any MIBs by default.
  6. # You might comment this lines once you have the MIBs downloaded.
  7. ExportMIBS=
  8.  
  9. # Snmpd control (yes means start daemon ).
  10. SNMPDRUN=Yes 
  11.  
  12. # Snmpd options (use syslog, close stdin/out/err ).
  13. #SNMPDOPTS='-Lsd-Lf/dev/null-u snmp-g snmp-I-smux-p/var/run/snmpd. pid'// Comment out and change it to the following content
  14. SNMPDOPTS='-Ls2d-Lf/dev/null-p/var/run/snmpd. pid-' 

After that, run the command to restart the snmpd service. Then, you can view the system logs again, which is much more refreshing.

#/Etc/init. d/snmpd restart // restart the service

Snmpd Log Level Definition:

  1. 0 or! -- LOG_EMERG,
  2. 1 or a -- LOG_ALERT,
  3. 2 or c -- LOG_CRIT,
  4. 3 or e -- LOG_ERR,
  5. 4 or w -- LOG_WARNING,
  6. 5 or n -- LOG_NOTICE,
  7. 6 or I -- LOG_INFO, and
  8. 7 or d -- LOG_DEBUG.

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.