3

I have a perl script that searches through our switches to find which one hosts a given IP address; this script uses net-snmp libraries to poll through a daisy-chain of ethernet switches (think core / distribution / access) until it finds the correct switch where the host is connected.

This script works fine on most of our linux machines, but I have one that that throws STDERR messages griping about missing 'zeroDotZero' in 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]$

How can I stop the error messages?

Mike Pennington
  • 8,266
  • 9
  • 41
  • 86

1 Answers1

3

The default net-snmp copy of SNMPv2-SMI has a definition for zeroDotZero...

[mpenning@lnxlmf ietf]$ cd /usr/share/snmp/mibs/
[mpenning@lnxlmf mibs]$ grep zeroDotZero SNMPv2-SMI.txt
zeroDotZero    OBJECT-IDENTITY
[mpenning@lnxlmf mibs]$

It turns out that I had installed an old copy of SNMPv2-SMI.my in my Cisco MIBs directory... this copy of SNMPv2-SMI.my did not have zeroDotZero and was over-riding net-snmp's copy, so I deleted it.

[mpenning@lnxlmf mibs]$ cd /usr/share/snmp/mibs/cisco/
[mpenning@lnxlmf cisco]$ grep zeroDotZero SNMPv2-SMI.my
[mpenning@lnxlmf cisco]$ sudo rm SNMPv2-SMI.my

Now the script runs without issues...

[mpenning@lnxlmf ~]$ perl findhost2.pl 192.0.2.29
192.0.2.29, 192.0.2.29, 0:27:e:22:9a:d5, core-switch2, 7/37

[mpenning@lnxlmf ~]$
Mike Pennington
  • 8,266
  • 9
  • 41
  • 86