Installing SNMP
Confirm that the SNMP agent is installed
Rpm-q NET-SNMP
If not installed, install SNMP
Yum Install Net-snmp
Set up auto-run SNMP on boot
/sbin/chkconfig snmpd on configuring SNMP
Modifying a configuration file
Back up the original configuration file, edit the/etc/snmp/snmpd.conf, simple configuration as follows
# First, map the community name ' public ' into a ' security name '
# Sec.name Source Community
Com2sec notconfiguser Default Public
####
# Second, map the security name into a group name:
# GroupName Securitymodel Securityname
Group Notconfiggroup v1 Notconfiguser
Group Notconfiggroup v2c Notconfiguser
####
# Third, create a view for us to let the group has 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.1
View 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 Notif
Access Notconfiggroup "" Any noauth exact systemview none None
Start SNMP
/ETC/INIT.D/SNMPD start
Restart the SNMP service if it is started
/ETC/INIT.D/SNMPD restart
Testing SNMP
To see if the port is open
Netstat-ln | grep 161
Installing the SNMP test tool
Yum Install Net-snmp-utils
Native Test SNMP data (modify monit for configured community name)
Snmpwalk-v 2c-c public localhost system
Snmpwalk-v3-u username-l auth-a md5-a password localhost
Create SNMP (v3) users
Net-snmp-config--create-snmpv3-user-ro-a MD5 Lyceemsnmp lyceem.com
Remotely test SNMP data (modify IP for Server ip,snmpwalk command requires installation of NET-SNMP)
Snmpwalk-v 2c-c Public IP system
So it is often handled
Error exclusion if the local test SNMP has data, the remote test SNMP is numerous because the server firewall prohibits the external Access server UDP 161 port:
Modify/etc/sysconfig/iptables (or:/etc/sysconfig/iptables-config) to add the following rule:
-A rh-firewall-1-input-p udp-m state cstate new-m UDP cdport 161-j ACCEPT
Restart Iptables
/etc/init.d/iptables restart
This article is from the "Lonely (Technology Group: 1991706)" blog, please be sure to keep this source http://304076020.blog.51cto.com/7503470/1545302
SNMP installation and use under Linux