CentOS installation and configuration snmp

Install

yum install net-snmp net-snmp-utils 

chkconfig snmpd on set boot up

net-snmp is the snmp software 
net-snmp-utils is the related tools we will use later

Execute under centos 6 series snmpd -v

NET-SNMP version:  5.5
Web:               http://www.net-snmp.org/
Email:             [email protected]

Tool version view snmpwalk -V

NET-SNMP version: 5.5

The same method is used on centos 7, except that snmp and its version are 5.7, and the rest is no different.

configuration file

#Add the following lines
#Specify the community name, allowing access to the IP address or address segment of the community name
rocommunity  week8 192.168.0.1/16
rocommunity  week8 192.168.0.1/16
rocommunity  week8 192.168.0.1/16
rocommunity  week8 192.168.0.1/16
rocommunity  week8 192.168.0.1/16
rocommunity  week8 192.168.0.1/16

 

test snmp

See if the port is open
netstat -ln | grep 161 

Install snmp testing tools
yum install net-snmp-utils 

native test snmp data
snmpwalk -v 2c -c week8localhost system

Remote test snmp data (modify ip to server ip, snmpwalk command needs to install net-snmp)
snmpwalk -v 2c -c public ip system

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324980343&siteId=291194637