晚上,配置Debian Linux的snmpd,使用基于SNMP协议的网管工具,获取系统支持的节点,过程简记如下。
环境:Debian 6,VMware 7, MG-SOFT MIB Browser
1. 安装snmp
apt-get install snmp snmpd
2. 配置snmpd
root@debian:/etc/snmp# vi snmpd.conf
1) 配置监视所有接口的连接(默认只监听本地系统)
agentAddressudp:161,udp6:[::1]:161
2) 配置团体串
这里配置了一个读取权限较大的(iso下)只读团体串。(默认public团体串只读取system + hrSystem groups下面的节点)
view AllView included .1 #配置视图AllView
rocommunity public default -V AllView #配置只读团体串
3. 在pc上运行MIB Browser读取
设置ip为Debian的eth0接口的ip,团体串设为public,从iso walk,可以看到Debian上的信息。
根据当前的机器配置,读取到了4278个实例。
***** SNMP QUERY STARTED *****
1: sysDescr.0 (octet string) Linux debian 2.6.32-5-686 #1SMP Mon Jun 13 04:13:06 UTC 2011 i686 [4C.69.6E.75.78.20.64.65.62.69.61.6E.20.32.2E.36.2E.33.32.2D.35.2D.36.38.36.20.23.31.20.53.4D.50.20.4D.6F.6E.20.4A.75.6E.20.31.33.20.30.34.3A.31.33.3A.30.36.20.55.54.43.20.32.30.31.31.20.69.36.38.36(hex)]
2: sysObjectID.0 (object identifier) enterprises.8072.3.2.10
3: sysUpTimeInstance (timeticks) 0 days 00h:00m:06s.22th (622)
4: sysContact.0 (octet string) Me <me@example.org> [4D.65.20.3C.6D.65.40.65.78.61.6D.70.6C.65.2E.6F.72.67.3E (hex)]
5: sysName.0 (octet string) debian[64.65.62.69.61.6E (hex)]
6: sysLocation.0 (octet string) Sitting on the Dock of the Bay [53.69.74.74.69.6E.67.20.6F.6E.20.74.68.65.20.44.6F.63.6B.20.6F.66.20.74.68.65.20.42.61.79 (hex)]
7: sysServices.0 (integer) 72
8: sysORLastChange.0 (timeticks) 0 days 00h:00m:00s.00th (0)
9: sysORID.1 (object identifier) snmpFrameworkMIBCompliance
10: sysORID.2 (object identifier) snmpMPDCompliance
11: sysORID.3 (object identifier) usmMIBCompliance
12: sysORID.4 (object identifier) snmpMIB
13: sysORID.5 (object identifier) tcpMIB
14: sysORID.6 (object identifier) ip
15: sysORID.7 (object identifier) udpMIB
16: sysORID.8 (object identifier) vacmBasi