[mrtg] Cisco Small Business (SG300) switches, cfgmaker and ifAlias

Rok Potočnik r at rula.net
Tue Oct 18 00:12:30 CEST 2011


I noticed someone else had the same problem about half a year ago, 
unfortunately nothing changed in the meantime...

I'm using the latest mrtg (cfgmaker for mrtg-2.17.2) and it seems 
cfgmaker doesn't recognize ifAlias entries, probably because it's 
checking the IOS versions of cisco switches...

$ /opt/mrtg/bin/cfgmaker --ifref=name --ifdesc=alias --show-op-down 
--global 'LogFormat: rrdtool' --global 'Interval: 10' --global 'Refresh: 
600' --global 'HtmlDir: /var/www/mrtg' --global 'ImageDir: 
/var/www/mrtg' --global 'LogDir: /var/lib/mrtg' --global 'ThreshDir: 
/var/lib/mrtg' --output /tmp/mrtg/SWITCHES/201.cfg community at 192.168.20.201
--base: Get Device Info on community at 192.168.20.201:
--base: Vendor Id: cisco
--base: Populating confcache
--base: Get Interface Info
--base: Walking ifIndex
--base: Walking ifType
--base: Walking ifAdminStatus
--base: Walking ifOperStatus
--base: Walking ifMtu
--base: Walking ifSpeed
--base: Writing /tmp/mrtg/SWITCHES/201.cfg

$ snmpwalk -v2c -c community 192.168.20.201 .1.3.6.1.2.1.31.1.1.1.18
IF-MIB::ifAlias.49 = STRING: PC 1
IF-MIB::ifAlias.50 = STRING: PC 2
IF-MIB::ifAlias.51 = STRING: PC 3
...


this kinda did the trick for me... (forgive my poor programming skills)

--- cfgmaker~   2011-10-17 19:28:28.000000000 +0200
+++ cfgmaker    2011-10-18 00:09:05.753575458 +0200
@@ -171,7 +171,7 @@
          push @Variables,  ($1 > 11.0 or $1 < 10.0 ) ? "ifAlias" : 
"CiscolocIfDescr";
          if ($1 > 11.2) {push @Variables, "vmVlan";};
         if ($1 > 11.3) {push @Variables, "vlanTrunkPortDynamicStatus";};
-    } elsif ( $routers->{$router}{deviceinfo}{Vendor} =~ 
/(?:hp|juniper|dlink|wwp|foundry|dellLan|force10|3com|extremenetworks|openBSD|arista)/) 
{
+    } elsif ( $routers->{$router}{deviceinfo}{Vendor} =~ 
/(?:cisco|hp|juniper|dlink|wwp|foundry|dellLan|force10|3com|extremenetworks|openBSD|arista)/) 
{
          push @Variables, "ifAlias";
      }

-- 
BR, Rok



More information about the mrtg mailing list