# cd /usr/local/src
# wget http://cdnetworks-kr-2.dl.sourceforge.net/project/net-snmp/net-snmp/5.5/net-snmp-5.5.tar.gz
# tar zxvf net-snmp-5.5.tar.gz
# cd net-snmp-5.5
# ./configure
(编译中会有交互过程。如选择版本等。)
# make
# make install
/usr/local/src/net-snmp-5.5/python/netsnmp/tests/snmpd.conf
将其cp到/etc下:
cp /usr/local/src/net-snmp-5.5/python/netsnmp/tests/snmpd.conf /etc/snmpd.conf
# /usr/local/sbin/snmpd -c /etc/snmpd.conf
(将/usr/local/sbin/snmpd -c /etc/snmpd.conf 加入到/etc/rc.d/rc.local中,成为开机自动启动)
看是否可以出现正常的查询结果。
# 1) 设置监控机的IP或监控机的网段,以及团体字映射到安全名
com2sec local 192.168.10.2 public
com2sec monitorhost 192.168.10.1 public
com2sec mynetwork1 92.168.1.0/24 public
# 2) 映射组名和安全名
group MyRWGroup v2c local
group MyRWGroup v2c monitorhost
group MyROGroup v2c mynetwork
# 3)设置mib subtree视图
view all included .1 80
# 4) 设置read/write权限
access MyROGroup "" any noauth exact all none none
access MyRWGroup "" any noauth exact all all none