NeDi Community

NeDi Software Specific => Discovery => Topic started by: GuyMontag on August 16, 2010, 01:50:06 PM

Title: CDP neighbor name issue (Nexus)
Post by: GuyMontag on August 16, 2010, 01:50:06 PM
After adding the Nexus 7000 and 1000v def files and an obligatory test run, I noticed odd device names (NX-OS only)  in the link section of the device status view.


Ethernet1/1 ESVBPL1R401 on Gi1/4 (Vlan0 FD) 1G 0 CDP
Ethernet1/2 ESVBPL1R402 on Gi1/6 (Vlan0 FD) 1G 0 CDP
Ethernet4/1 TBMXXXXXXX on Et4/1 (Vlan0 FD) 10G 0 CDP
Ethernet4/9 12312xxxxxxxxxxxxxxx22 on Et4/1 (Vlan0 FD) 10G 0 CDP

I've xed the Numbers out as I know nothing about their relevance.

So I issued the show cdp neighbour command on one of the NX switches
ESVBPL1R4NX01(config)# sh cdp neighbors
Capability Codes: R - Router, T - Trans-Bridge, B - Source-Route-Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater,
                  V - VoIP-Phone, D - Remotely-Managed-Device,
                  s - Supports-STP-Dispute

Device-ID             Local Intrfce Hldtme Capability  Platform      Port ID
ESVBC9R1NX01(TBMXXXXXXX)
                       Eth4/1        177    R S I s     N7K-C7018     Eth4/1
vsvbpvsm01(12312xxxxxxxxxxxxxxx22)
                       Eth4/9        158    R S I s     Nexus1000V    Eth4/1
vsvbpvsm01(12312xxxxxxxxxxxxxxx22)
                       Eth4/9        145    R S I s     Nexus1000V    Eth3/1

As the output indicates, nedi is displaying the value in the brackets.

After messing around with the NX config, reading cisco manuals and various google searches, i decided to dig into the nedi code and search for the cause of the issue.

It quickly turned out, that a line (1035) in the CDP part of the libsnmp.pl file, which was apparently added to fix a name issue with CatOS switches is now causing the problem with the NX-OS switches.

As a workaround  I changed a few lines:

from
Code: [Select]
}elsif($k[13] == 6){
                                my $nebid = &misc::Strip($val);
                                $neb{$k[14]}{$k[15]}{'id'} = $nebid;
                                $neb{$k[14]}{$k[15]}{'na'} = $nebid;
                                $neb{$k[14]}{$k[15]}{'na'} =~ s/(.*?)\((.*?)\)/$2/;                     # Extract from CatOS
                                $neb{$k[14]}{$k[15]}{'na'} =~ s/(\xff){1,}/BadCDP-$k[16]/;              # Fixes some phone weirdness

                        }elsif($k[13] == 7){


to
Code: [Select]
}elsif($k[13] == 6){
                                my $nebid = &misc::Strip($val);
                                $neb{$k[14]}{$k[15]}{'id'} = $nebid;
                                $neb{$k[14]}{$k[15]}{'na'} = $nebid;
                                if($main::dev{$dv}{os} =~/CatOS/){
                                        $neb{$k[14]}{$k[15]}{'na'} =~ s/(.*?)\((.*?)\)/$2/;                     # Extract from CatOS
                                }
                                else{
                                        $neb{$k[14]}{$k[15]}{'na'} =~ s/\(.*?\)//g;                             # Remove trailing random? value from NX-OS
                                }
                                $neb{$k[14]}{$k[15]}{'na'} =~ s/(\xff){1,}/BadCDP-$k[16]/;              # Fixes some phone weirdness

                        }elsif($k[13] == 7){


Not sure if it still works with CatOS as I don't have devices to test with...
Title: Re: CDP neighbor name issue (Nexus)
Post by: rickli on August 16, 2010, 10:38:07 PM
Thanks for investing time in this...amazing how this stuff keeps coming back...

It would need to be specific on the neighbour ID though in order to distinguish a Nexus from a CatOS (the comment does not refer to the current dev, but how the neighbour announces itself)...
Title: Re: CDP neighbor name issue (Nexus)
Post by: rufer on August 17, 2010, 08:13:38 AM
Maybe this is related to the NX-OS virtual port channel stuff?

Greetings
Rufer
Title: Re: CDP neighbor name issue (Nexus)
Post by: GuyMontag on August 17, 2010, 08:33:42 AM
Could be, but VPC is currently not enabled...