Simple Network Management Protocol (SNMP), consisting of a set of standards for network management, comprising an application-layer protocol (Application layer protocol), a database model (DB Schema), and a set of resource objects. The following and 111CN Small series look at the CENTOS6 system SNMP monitoring installation configuration and use.
Install NET-SNMP
CentOS and other Redhat series products provide a NET-SNMP binary package. We can install it directly from the source.
Example
Yum Install Net-snmp net-snmp-devel net-snmp-utils
Description: Net-snmp-devel is to use Net-snmp-config, Net-snmp-utils is to use Snmpwalk.
Configure NET-SNMP
Example
Create-snmpv3-user-ro-a Snmp@jiankongbao-a MD5 Jiankongbao
Above command, create a Snmpv3 user, read only, use MD5, username is Jiankongbao, password is Snmp@jiankongbao.
Note: Please deactivate the NET-SNMP service before running.
Example
Service SNMPD Stop
Run NET-SNMP
The method of running NET-SNMP service is relatively simple, but the name of NET-SNMP service is snmpd.
Example
Service SNMPD Start
If you want to join the boot Autorun Service list:
Example
Chkconfig snmpd on
Detect NET-SNMP
We can use Snmpwalk to detect if the SNMP service is turned on properly.
Example
Snmpwalk-v 3-u jiankongbao-a md5-a "Snmp@jiankongbao"-l authnopriv 127.0.0.1 SYSDESCR
If everything works, it will return to normal results.
With a firewall, you have to open the UDP 161 port.
[Root@zhudoubaby ~]# Iptables-l
Chain INPUT (Policy ACCEPT)
Target Prot opt source destination
Rh-firewall-1-input All-anywhere anywhere
Chain FORWARD (Policy ACCEPT)
Target Prot opt source destination
Rh-firewall-1-input All-anywhere anywhere
Chain OUTPUT (Policy ACCEPT)
Target Prot opt source destination
Chain Rh-firewall-1-input (2 references)
Target Prot opt source destination
ACCEPT UDP--anywhere anywhere state NEW UDP DPT:SNMP (required)
ACCEPT TCP--Anywhere anywhere state NEW TCP DPT:SMTP (NO)
Using procedure error logging
Note: Sometimes entering service SNMPD status appears
SNMPD dead but PID file exists
Or
SNMPD dead but Subsys locked
The reason is not to enter SNMPD first, the principle is not very clear, but first remember.