sudo apt-get install snmp snmpd
vim /etc/snmp/snmpd.conf

1.将原有“agentAddress udp:127.0.0.1:161”改为:

agentAddress 10.0.2.100 /*192.168.1.9为本机IP,即监控服务器要监控的主机IP*/

2.加入一行如下:

access MyROSystem "" any noauth exact all none none

3.将原有“rocommunity public default -V systemonly” 的"-V systemonly" 参数去掉,变成:

rocommunity public default

4.将“#trap2sink localhost public”和“#informsink localhost public”前面的“#”去掉,改为:

trap2sink localhost public

informsink localhost public

5.重启SNMP服务:

/etc/init.d/snmpd restart

6.检验snmp获取数据:

snmpwalk -v 2c -c public 10.0.2.100