Snmp installation, snmp
Switch to the system administrator account
1. 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
2. Configure snmp
Modify/etc/snmp/snmpd. conf
Change Group Name
Find the following lines
Sec. name source community
Com2sec notConfigUser default public
Change the public group name to any other field, for example:
Com2sec notConfigUser default monit
Grant read permission
Find the following lines
Group context sec. model sec. level prefix read write notif
Access notConfigGroup "" any noauth exact systemview none
Change the read permission systemview to all, for example:
Access notConfigGroup "" any noauth exact all none
Find the following lines
Incl/excl subtree mask
View all supported ded. 1 80
Remove # Before view all, for example:
View all supported ded. 1 80
3. Start snmp
Service snmpd start
Restart the snmp service if it has been started.
Service snmpd restart
4. 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 monit localhost system
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 monit ip system
5. Firewall enables UDP161 Port
Iptables-I INPUT-p udp-dport 8091-j ACCEPT
Or directly modify the firewall configuration file.
Vi/etc/sysconfig/iptables
Insert the following after other port number rules:
-A input-p udp-m udp-dport 161-j ACCEPT
Restart the firewall to make the rule take effect
Service iptables restart