oetiker / mrtg

MRTG - Multi Router Traffic Grapher
http://www.mrtg.org
243 stars 60 forks source link

cfgmaker confuses Cisco code versions on Nexus #93

Closed nistorj closed 1 year ago

nistorj commented 2 years ago

We ran into an interesting issue tonight that I believe has to do with roughly this code section:

// cfgmaker lines ~176

    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";
        print "DEBUG VERSION ===> $1 \n";
        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|arist
a|enterasys|zyxel|vyatta)/i) {
        push @Variables, "ifAlias";
    }

When I added the DEBUG line in there the output of my version is 10.2, as per my NXOS version:

RFC1213-MIB::sysDescr.0 = STRING: "Cisco NX-OS(tm) Nexus9000 C9364C, Software (NXOS 64-bit), Version 10.2(1), RELEASE SOFTWARE Copyright (c) 2002-2021 by Cisco Systems, Inc. Compiled 8/23/2021 17:00:00"

It seems to think the answer should be CiscolocIfDescr when in fact it needs to be ifAlias.

To validate this we simply changed the version accordingly and it had solved our issue.

We narrowed this down in our testing using custom templates outputting all the info and noticed that ifAlias and cisco_descr were both empty.

nistorj commented 2 years ago

PInging @oetiker :)

oetiker commented 1 year ago

I saw your report, my problem is that I have no clue about cisco product differences ... so you are saying for your version of nxos ifAlias would do too, and there was no need to resort to CiscolocIfDescr?

nistorj commented 1 year ago

Hi,

Correct, no need to resort to CiscolocIfDescr. As a matter of fact I would suggest ripping out that entire section of code. It appears that code block is legacy for some extremely old versions of IOS that are no longer in circulation. All modern versions of code work perfectly fine without the need for CiscolocIfDescr.

oetiker commented 1 year ago

that sounds reasonable ... would you like to provide a PR ?

nistorj commented 1 year ago

https://github.com/oetiker/mrtg/pull/95

nistorj commented 1 year ago

Closing issue, merged fixed.