Configure SNMP for centos

Source: Internet
Author: User
Tags snmp snmpwalk
<Span style = "font-size: 14px;"> This article describes how to configure a simple SNMP Service in the centos environment </span>
Software Installation

Switch to the system administrator account

Install SNMP
Check that the SNMP agent is installed.
Rpm-Q net-snmp
If not, install SNMP
Yum install net-snmp


Set automatic SNMP running upon startup
/Sbin/chkconfig snmpd on Configure SNMP


Modify configuration file

Back up the original configuration file and edit/etc/snmp/snmpd. conf. The simple configuration is as follows:

# First, map the community name "public" into a "security name"#       sec.name  source          communitycom2sec notConfigUser  default       public##### Second, map the security name into a group name:#       groupName      securityModel securityNamegroup   notConfigGroup v1           notConfigUsergroup   notConfigGroup v2c           notConfigUser##### Third, create a view for us to let the group have rights to:# Make at least  snmpwalk -v 1 localhost -c public system fast again.#       name           incl/excl     subtree         mask(optional)view    systemview    included   .1.3.6.1.2.1.1view    systemview    included   .1.3.6.1.2.1.25.1.1##### Finally, grant the group read-only access to the systemview view.#       group          context sec.model sec.level prefix read   write  notifaccess  notConfigGroup ""      any       noauth    exact  systemview none none

Start SNMP

/Etc/init. d/snmpd start
Restart the SNMP service if it has been started.
/Etc/init. d/snmpd restart

Test SNMP

Check whether the port is enabled
Netstat-ln | grep 161

Install the SNMP Test Tool
Yum install net-snmp-utils

Test SNMP data on the local machine (modify monit to the group name configured)
Snmpwalk-V 2C-C public localhost System

Snmpwalk-V3-u username-l auth-a MD5-a password localhost

Create an SNMP (V3) User

Net-snmp-config -- create-snmpv3-user-ro-a MD5 lyceemsnmp lyceem.com

Remote Test of SNMP data (modify the IP address to the server IP address, and install net-snmp for the snmpwalk command)
Snmpwalk-V 2C-C public IP system


It is often handled
Troubleshooting if the local test SNMP has data and the Remote Test SNMP has no data, the server firewall prohibits external access to port UDP 161 of the server:
Modify/etc/sysconfig/iptables (or:/etc/sysconfig/iptables-config) and add the following rules:
-A RH-Firewall-1-INPUT-p udp-M state cstate New-m udp cdport 161-J accept
Restart iptables
/Etc/init. d/iptables restart

Configure SNMP for centos

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.