我有一个 perl 脚本,用于搜索我们的交换机以查找哪个主机拥有给定的 IP 地址;该脚本使用net-snmp
库通过以太网交换机的菊花链(想想核心/分布/访问)进行轮询,直到它找到连接主机的正确交换机。
这个脚本在我们的大多数 Linux 机器上运行良好,但我有一个会抛出 STDERR 消息抱怨缺少“zeroDotZero”SNMPv2-SMI
[mpenning@lnxlmf ietf]$ perl ~/findhost2.pl 192.0.2.30
192.0.2.30, 192.0.2.30, No log handling enabled - turning on stderr logging
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/cisco/IP-MIB.my)
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/cisco/EVENT-MIB.my)
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/DISMAN-SCHEDULE-MIB.txt)
No log handling enabled - turning on stderr logging
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/cisco/IP-MIB.my)
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/cisco/EVENT-MIB.my)
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/DISMAN-SCHEDULE-MIB.txt)
No log handling enabled - turning on stderr logging
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/cisco/IP-MIB.my)
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/cisco/EVENT-MIB.my)
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/DISMAN-SCHEDULE-MIB.txt)
No log handling enabled - turning on stderr logging
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/cisco/IP-MIB.my)
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/cisco/EVENT-MIB.my)
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/DISMAN-SCHEDULE-MIB.txt)
No log handling enabled - turning on stderr logging
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/cisco/IP-MIB.my)
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/cisco/EVENT-MIB.my)
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/DISMAN-SCHEDULE-MIB.txt)
0:1e:b:26:78:d9, No log handling enabled - turning on stderr logging
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/cisco/IP-MIB.my)
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/cisco/EVENT-MIB.my)
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/DISMAN-SCHEDULE-MIB.txt)
No log handling enabled - turning on stderr logging
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/cisco/IP-MIB.my)
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/cisco/EVENT-MIB.my)
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/DISMAN-SCHEDULE-MIB.txt)
No log handling enabled - turning on stderr logging
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/cisco/IP-MIB.my)
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/cisco/EVENT-MIB.my)
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/DISMAN-SCHEDULE-MIB.txt)
No log handling enabled - turning on stderr logging
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/cisco/IP-MIB.my)
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/cisco/EVENT-MIB.my)
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/DISMAN-SCHEDULE-MIB.txt)
No log handling enabled - turning on stderr logging
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/cisco/IP-MIB.my)
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/cisco/EVENT-MIB.my)
Did not find 'zeroDotZero' in module SNMPv2-SMI (/usr/share/snmp/mibs/DISMAN-SCHEDULE-MIB.txt)
192.0.2.254, Gi5/44
[mpenning@lnxlmf ietf]$
我怎样才能停止错误信息?
的默认
net-snmp
副本SNMPv2-SMI
具有 zeroDotZero 的定义...事实证明,我
SNMPv2-SMI.my
在我的 Cisco MIBs 目录中安装了一个旧副本...这个副本SNMPv2-SMI.my
没有 zeroDotZero 并且覆盖了net-snmp
的副本,所以我删除了它。现在脚本运行没有问题......