sudo apt-get install snmp snmpd snmp-mibs-downloader
# Install snmp
sudo service snmpd status
# Check the running status of snmpd
snmpwalk -v 2c -c public localhost 1.3.6.1.2.1.1.1
# Test it will return the relevant information of the linux system
For example iso.3.6.1.2.1.1.1.0= STRING: "Linux leaf
4.2.0- 34- generic #39-Ubuntu SMP Thu Mar 1022:13:01 UTC 2016 x86_64"
sudo vi /etc/snmp/snmpd.conf
agentAddress udp:127.0.0.1:161
#Modify to agentAddress udp:0.0.0.0:161(If you customize the port, just tell me)
#About 45 lines
view systemonly included .1.3.6.1.2.1.1
view systemonly included .1.3.6.1.2.1.25.1
#Add a new line below
view systemonly included .1
#About 52 lines
rocommunity publicdefault-V systemonly
public-->Modified into a custom community
default-->Modified to snmp receiving server 210.X.X.X
rocommunity XXXX(Define a community)210.X.X.X
sudo service snmpd restart #Restart service
After the configuration is complete, use the modified port and community for monitoring.
Recommended Posts