[mrtg-developers] Patch for cfgmaker to use ifAlias on hp procurve (2524, and... ????) switches

Horror Vacui faruk at aon.at
Fri Jun 16 14:45:12 MEST 2006


Hi

We got new HP ProCurve 2524 switches. cfgmaker refused to walk ifAlias for these things (so port names were ignored). So I hacked cfgmaker to do it. I've absolutely no idea what I've been doing, but it worked. Here's the patch:

######begin patch
--- /usr/bin/cfgmaker   2005-09-07 14:56:12.000000000 +0200
+++ /usr/bin/cfgmaker.patched   2006-06-16 12:38:00.000000000 +0200
@@ -128,7 +128,7 @@
         $routers->{$router}{deviceinfo}{sysDescr} =~ m/Version\s+(\d\d\.\d+)/) {
         push @Variables,  ($1 > 11.0) ? "ifAlias" : "CiscolocIfDescr";
         if ($1 > 11.2) {push @Variables, "vmVlan";};
-    } elsif ( $routers->{$router}{deviceinfo}{Vendor} =~ /(?:juniper|foundry|dellLan)/) {
+    } elsif ( $routers->{$router}{deviceinfo}{Vendor} =~ /(?:juniper|foundry|dellLan|hp)/) {
         push @Variables, "ifAlias";
     }
 
@@ -818,6 +818,7 @@
             # sysObjectID                Vendora
             '1.3.6.1.4.1.43.' =>        '3com',
             '1.3.6.1.4.1.9.' =>         'cisco',
+            '1.3.6.1.4.1.11.' =>         'hp',
             '1.3.6.1.4.1.674.10895.' => 'dellLan',
             '1.3.6.1.4.1.1916.' =>      'extremenetworks',
             '1.3.6.1.4.1.1991.' =>      'foundry',
######end patch

I figured out that this part of code seems to be looking for sysObjectID.0, which on the ciscos is:
OID: SNMPv2-SMI::enterprises.9.1.278
...and on the procurves:
OID: SNMPv2-SMI::enterprises.11.2.3.7.11.19
...so I used 1.3.6.1.4.1.11 to identify it as a hp switch. Perhaps the full OID would be better? Hope I'll have time to look into the code and figure out what it really does, but it'd be nice if someone more knowledgeable helped me on this...

cheers
Horror

-- 

Horror Vacui @ Work

Ars Electronica Center, www.aec.at

--
Unsubscribe mailto:mrtg-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:mrtg-developers-request at list.ee.ethz.ch?subject=help
Archive     http://lists.ee.ethz.ch/mrtg-developers



More information about the mrtg-developers mailing list