Warning: Declaration of PageLinesHighlight::section_template($clone_id) should be compatible with PageLinesSection::section_template() in /var/www/marcusnyberg.com/wp-content/themes/pagelines/sections/highlight/section.php on line 0

Warning: Declaration of PLheroUnit::section_template($clone_id) should be compatible with PageLinesSection::section_template() in /var/www/marcusnyberg.com/wp-content/themes/pagelines/sections/hero/section.php on line 0

Warning: Declaration of PageLinesBanners::section_template($clone_id) should be compatible with PageLinesSection::section_template() in /var/www/marcusnyberg.com/wp-content/themes/pagelines/sections/banners/section.php on line 0

Warning: Declaration of PageLinesCarousel::section_template($clone_id) should be compatible with PageLinesSection::section_template() in /var/www/marcusnyberg.com/wp-content/themes/pagelines/sections/carousel/section.php on line 0

Warning: Declaration of PLMasthead::section_template($clone_id) should be compatible with PageLinesSection::section_template() in /var/www/marcusnyberg.com/wp-content/themes/pagelines/sections/masthead/section.php on line 0

Warning: Declaration of PLNavBar::section_template($clone_id, $location = '') should be compatible with PageLinesSection::section_template() in /var/www/marcusnyberg.com/wp-content/themes/pagelines/sections/navbar/section.php on line 0

Warning: Declaration of PageLinesQuickSlider::section_template($clone_id) should be compatible with PageLinesSection::section_template() in /var/www/marcusnyberg.com/wp-content/themes/pagelines/sections/quickslider/section.php on line 0

Warning: Declaration of PageLinesQuickSlider::section_head($clone_id) should be compatible with PageLinesSection::section_head() in /var/www/marcusnyberg.com/wp-content/themes/pagelines/sections/quickslider/section.php on line 0

Warning: Declaration of PageLinesFeatures::section_template($clone_id) should be compatible with PageLinesSection::section_template() in /var/www/marcusnyberg.com/wp-content/themes/pagelines/sections/features/section.php on line 0

Warning: Declaration of PageLinesFeatures::section_head($clone_id) should be compatible with PageLinesSection::section_head() in /var/www/marcusnyberg.com/wp-content/themes/pagelines/sections/features/section.php on line 0
Marcus Nyberg | ifdesc=alias problems with Mrtg cfgmaker

Today I had problem with MRTG’s cfgmaker. When I used the parameter ifdesc=alias it didn’t pick up the correct SNMP OID’s, instead it defaulted to ifdesc=desc. Hmm, very strange. Then I started to investigate the problem and found out that cfgmaker can be debugged because it is a perl script.

To be able to debug cfgmaker you only have to edit one line at the top of the program.
@main::DEBUG=qw(base snpo snpd);

After doing this I ran cfgmaker again and spotted that it did not do any SNMP walk on alias (ifAlias). It turns out that cfgmaker has to know what kind of hardware it is polling to be able to use ”alias”. In my case I was polling an ”Ericsson SSR 8020” which wasn’t recognized by cfgmaker.

I had to add ”Ericsson” to the vendor identification list. If your hardware is not in that list, you can’t use the alias option.

# vendor identification
debug('base',"$DevInfo{sysObjectID}");
my %vendorIDs = (
# Add your vendor here
# sysObjectID Vendora
'1.3.6.1.4.1.43.' => '3com',
'1.3.6.1.4.1.11.' => 'hp',
'1.3.6.1.4.1.9.' => 'cisco',
'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',
'1.3.6.1.4.1.6027.' => 'force10',
'1.3.6.1.4.1.2636.' => 'juniper',
'1.3.6.1.4.1.94.' => 'nokiaipsofw',
'1.3.6.1.4.1.307.' => 'portmaster',
'1.3.6.1.4.1.2352.1.17' => 'ericsson'
);
foreach (keys %vendorIDs) {
$DevInfo{Vendor} = $vendorIDs{$_} if ($DevInfo{sysObjectID} =~ /\Q$_\E/);
}
debug('base',"Vendor Id: $DevInfo{Vendor}");

Then ericsson had to be added to the InterfaceInfo subroutine:


if ($routers->{$router}{deviceinfo}{Vendor} eq 'cisco' &&
$routers->{$router}{deviceinfo}{sysDescr} =~ m/Version\s+(\d+\.\d+)/) {
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|foundry|dellLan|force10|3com|extremenetworks|ericsson)/) {
push @Variables, "ifAlias";
}

Then it worked! cfgmaker finally walked ifAlias for the interfaces.

Share →

One Response to ifdesc=alias problems with Mrtg cfgmaker

  1. Søren skriver:

    Awesome post, just solved my problem with some IBM switches!

Kommentera

E-postadressen publiceras inte. Obligatoriska fält är märkta *