安裝snmp
#yum install -y net-snmp net-snmp-utils net-snmp-devel
請確保安裝如下幾個包:
# rpm -qa |grep snmp
net-snmp-5.1.2-11.EL4.7
net-snmp-libs-5.1.2-11.EL4.7
net-snmp-devel-5.1.2-11.EL4.7
net-snmp-utils-5.1.2-11.EL4.7
net-snmp-perl-5.1.2-11.EL4.7修改配置文件snmpd.conf
#vim /etc/snmp/snmpd.conf
1、 com2sec notConfigUser default public
改爲: com2sec notConfigUser 127.0.0.1 public
如果要在別的機器(192.168.3.192)上運行觀測軟件監測(本機ip是192.168.3.190),也應該再加上:
com2sec notConfigUser 192.168.3.192 public
2、 access notConfigGroup "" any noauth exact systemview none none
改爲: access notConfigGroup "" any noauth exact all none none
3、開啓該行view all included .1 80
3.重啓snmpd服務
#service snmpd restart
4.使用snmp進行監控
#snmpwalk -v 2c -c public localhost