One configuration SNMP
1. Installing NET-SNMP
sudo yum-y install Net-snmp
2. Back up the snmpd.conf file
sudo cp/etc/snmp/snmpd.conf/etc/snmp/snmpd.conf20150625
3. Clear and re-edit snmpd.conf
Rocommunity Public 127.0.0.1rocommunity publicly 10.10.47.65rocommunity public 10.10.47.66rocommunity public 60. 195.252.107rocommunity Public 60.195.252.110
10.10.47.65 is the intranet IP of the host that installed the monitor and treasure plugin.
4. Restart SNMPD
sudo service snmpd restart
5. Verify that the SNMPD has been started
sudo netstat-tulnp|grep 161
Perform the following actions on any machine
The machine executing the snmpwalk needs to be documented in the snmpd.conf.
sudo snmpwalk-v2c-c public 10.10.47.65
nmpv2-mib::sysoruptime.8 = timeticks: (2) 0:00:00.02if-mib::ifnumber.0 = integer : 2if-mib::ifindex.1 = integer: 1if-mib::ifindex.2 = integer: 2if-mib:: ifdescr.1 = string: loif-mib::ifdescr.2 = string: eth0if-mib::iftype.1 = integer: softwareloopback (IF-MIB::IFTYPE.2 = INTEGER: ETHERNETCSMACD) (6) IF-MIB:: ifmtu.1 = integer: 16436if-mib::ifmtu.2 = integer: 1500if-mib::ifspeed.1 = Gauge32: 10000000IF-MIB::ifSpeed.2 = Gauge32: 0IF-MIB::ifPhysAddress.1 = string: if-mib::ifphysaddress.2 = string: 52:54:0:8b:f2:fcif-mib::ifadminstatus.1 = integer: up (1) if-mib::ifadminstatus.2 = integer: up (1) if-mib::ifoperstatus.1 = integer: up (1) if-mib::ifoperstatus.2 = integer: up (1) if-mib::iflastchange.1 = Timeticks: (0) 0:00:00.00if-mib::iflastchange.2 = timeticks: (0) 0:00:00.00if-mib::ifinoctets.1 = counter32: 628285088if-mib::ifinoctets.2 = counter32: 3060855740if-mib:: ifinucastpkts.1 = counter32: 137622023if-mib::ifinucastpkts.2 = counter32: 1929135244if-mib::ifinnucastpkts.1 = counter32: 0
6. Setting up a firewall
If the monitored host has set up a firewall, you need to open UDP port 161
Iptables-i input-p UDP--dport 161-j ACCEPT
Reference article:
Http://www.jiankongbao.com/search/SNMP
This article is from the Linux SA John blog, so be sure to keep this source http://john88wang.blog.51cto.com/2165294/1665614
Monitor the CentOS host with the monitoring treasure