I recently stumbled across a problem in MRTG when I was attempting to graph the utilization of a 10Gb interface on a 8683XLR card within a ERS 8600 switch. I noticed that the MaxBytes value that was listed in the MRTG configuration file was 176258176 (176.3 MBytes/s). While this was obviously incorrect I wondered how that value came to be.
I quickly fired up the trusty snmp-net toolset (snmpget) and confirmed from a CentOS Linux host that the ifSpeed OID was returning 1410065408, which is of course is not the correct value for a 10Gb interface. The problem here is that a 32 bit integer can only hold a maximum value of 2^32 – 1 (4,294,967,295). While I believe other manufacturers will just return the maximum value (4,294,967,295) the Nortel switch appears to return a very odd value. I’m not exactly sure why it’s returning that value, perhaps someone from Nortel can help answer that question.
How to fix it?
The Perl script that builds the configuration files for MRTG, cfgmaker, requires a little editing so that it knows how to react if it receives the odd value of 1410065408 when it polls the ifSpeed OID. Here’s the necessary edit;
223c223 < if ( (not defined $value) || ($value == 2**32-1)) { --- > if ( (not defined $value) || ($value == 2**32-1) || ($value = 1410065408) ) {
This edit will cause the configuration script to ignore the ifSpeed value and use the ifHighSpeed value which should return a proper value for MaxBytes of 1250000000 (1250.0 MBytes/s).
A quick word of warning here, you MUST use SNMP v2 with MRTG in order to see the ifHighSpeed OID.
Here’s an example of the paramaters I use when calling the cfgmaker script;
/usr/local/mrtg/bin/cfgmaker --global "PathAdd: /usr/local/rrdtool/bin" --global "LibAdd: /usr/local/rrdtool/lib/perl" --global "WorkDir: /var/www/html/mrtg/mdc" --global "IconDir: /mrtg/" -global "WithPeak[_]: wmy" --global "LogFormat: rrdtool" --ifdesc=descr --no-down --zero-speed=100000000 --snmp-options=:::::2 snmpreadstring@sw-ers8600.dc.acme.org -output=sw-ers8600.dc.acme.org.cfg
The parameter “–snmp-options=:::::2” above tells cfgmaker and MRTG to use SNMP v2 when polling the switch so it can retrieve the 64 bit counters such as ifHCInOctets and ifHCOutOctets as well as ifHighSpeed.
Cheers!
Update: Thursday July 17, 2008
I went back and decided to test the 10GB XFP ports on the Nortel Ethernet Routing Switch 5530. Interestingly enough that switch returns a value of 4294967295 when you query the ifSpeed OID. The output produced by cfgmaker correctly identifies that port as MaxBytes 1250000000 (1250.0 MBytes/s). I may need to call Nortel myself just to satisfy my curiousity on this one.
Cheers!
Update: Wednesday July 23, 2008
It seems that this problem was corrected in software v4.1.5.4 and later for the Ethernet Routing Switch 8600. I was able to confirm that an ERS 8600 switch running v4.1.5.4 does return 4294967295 as expected. Here’s the blurb from the release notes;
MIB value for ifSpeed is now displayed correctly for any 10 Gigabit interface.(Q01174158-01)
Cheers!