Open awcrate opened 1 year ago
I am not sure it is using show lldp neighbors
, I think on the show lldp neighbors details
something is getting tripped up.
You are failing here: https://github.com/napalm-automation/napalm/blob/7ecb9b9a330579fc9669b92b2bb56ff54131e83a/napalm/ios/ios.py#L990
Which is referencing remote_chassis_id
, here:
https://github.com/napalm-automation/napalm/blob/7ecb9b9a330579fc9669b92b2bb56ff54131e83a/napalm/ios/ios.py#L989
Which is defined in template, here: https://github.com/napalm-automation/napalm/blob/7ecb9b9a330579fc9669b92b2bb56ff54131e83a/napalm/ios/utils/textfsm_templates/show_lldp_neighbors_detail.tpl#L12
Can you show me your show lldp neighbors details
?
Compare that to what is showing in mocked responses as shown here: https://github.com/napalm-automation/napalm/blob/d782cc72c4adc24de168a8b0a594a61ec90d4472/test/ios/mocked_data/test_get_lldp_neighbors_detail/alternate/show_lldp_neighbors_detail.txt#L3
Thank you for your response.
Please note that napalm --vendor ios --user USER --PASSWORD HOSTNAME call get_lldp_neighbors_detail
does not throw any errors.
An uncensored version of the following output can be provided if necessary.
show lldp neighbors detail
------------------------------------------------
Chassis id: 0000.0000.0000
Port id: PORT
Port Description - not advertised
System Name: HOSTNAME
System Description:
DESCRIPTION 0000.0000.0000 (stable) MODEL
Time remaining: 111 seconds
System Capabilities: B,R
Enabled Capabilities: B,R
Management Addresses:
IP: 0000.0000.0000.00
IPV6: ::
IPV6: ::
Auto Negotiation - not supported
Physical media capabilities - not advertised
Media Attachment Unit type - not advertised
Vlan ID: - not advertised
------------------------------------------------
Chassis id: 0000.0000.0000
Port id: PORT
Port Description: DESC
System Name: HOST-0000.0000.0000
System Description:
Arista Networks EOS version 0000.0000.0000 running on an Arista Networks DCS-7280SR2-48YC6
Time remaining: 21 seconds
System Capabilities: B,R
Enabled Capabilities: B,R
Management Addresses:
IP: 0000.0000.0000.58
Auto Negotiation - not supported
Physical media capabilities - not advertised
Media Attachment Unit type - not advertised
Vlan ID: - not advertised
------------------------------------------------
Chassis id: 0000.0000.0000
Port id: PORT
Port Description - not advertised
System Name: HOST
System Description:
MikroTik RouterOS 0000.0000.0000 (long-term) CCR1009-8G-1S-1S+
Time remaining: 109 seconds
System Capabilities: B,R
Enabled Capabilities: B,R
Management Addresses:
IP: 0000.0000.0000.150
IPV6: ::
IPV6: ::
Auto Negotiation - not supported
Physical media capabilities - not advertised
Media Attachment Unit type - not advertised
Vlan ID: - not advertised
------------------------------------------------
Chassis id: 0000.0000.0000
Port id: PORT
Port Description: DESC
System Name: CRE1B-0000.0000.0000
System Description:
Arista Networks EOS version 0000.0000.0000.1M running on an Arista Networks DCS-7280SR2A-48YC6
Time remaining: 112 seconds
System Capabilities: B,R
Enabled Capabilities: B,R
Management Addresses:
IP: 0000.0000.0000.115
Auto Negotiation - not supported
Physical media capabilities - not advertised
Media Attachment Unit type - not advertised
Vlan ID: 0
------------------------------------------------
Chassis id: 0000.0000.0000
Port id: PORT
Port Description: PORTDESC
System Name: 0000.0000.0000.com
System Description:
Cisco IOS Software, c7600rsp72043_rp Software (c7600rsp72043_rp-ADVIPSERVICESK9-M), Version 15.2(4)S4a, RELEASE SOFTWARE (fc1)
Technical Support: http://0000.0000.0000/techsupport
Copyright (c) 1986-2013 by Cisco Systems, Inc.
Compiled Mon 07-Oct-13 13:22
Time remaining: 100 seconds
System Capabilities: B,R
Enabled Capabilities: B,R
Management Addresses:
IP: 0000.0000.0000.125
IPV6: ::
Auto Negotiation - not supported
Physical media capabilities - not advertised
Media Attachment Unit type - not advertised
Vlan ID: - not advertised
------------------------------------------------
Chassis id: 0000.0000.0000
Port id: PORT
Port Description: DESC
System Name: HOST-0000.0000.0000
System Description:
Arista Networks EOS version 0000.0000.0000 running on an Arista Networks DCS-7280SR2-48YC6
Time remaining: 115 seconds
System Capabilities: B,R
Enabled Capabilities: B,R
Management Addresses:
IP: 0000.0000.0000.61
Auto Negotiation - not supported
Physical media capabilities - not advertised
Media Attachment Unit type - not advertised
Vlan ID: 0
------------------------------------------------
Chassis id: 0000.0000.0000
Port id: PORT
Port Description: DESC
System Name: LEAF1B-0000.0000.0000
System Description:
Arista Networks EOS version 0000.0000.0000 running on an Arista Networks DCS-7280SR2-48YC6
Time remaining: 115 seconds
System Capabilities: B,R
Enabled Capabilities: B,R
Management Addresses:
IP: 0000.0000.0000.61
Auto Negotiation - not supported
Physical media capabilities - not advertised
Media Attachment Unit type - not advertised
Vlan ID: 0
------------------------------------------------
Chassis id: 0000.0000.0000
Port id: 0/51
Port Description - not advertised
System Name - not advertised
System Description - not advertised
Time remaining: 96 seconds
System Capabilities - not advertised
Enabled Capabilities - not advertised
Management Addresses - not advertised
Auto Negotiation - not supported
Physical media capabilities - not advertised
Media Attachment Unit type - not advertised
Vlan ID: 0
------------------------------------------------
Chassis id: 0000.0000.0000
Port id: PORT
Port Description: DESC
System Name: HOST-0000.0000.0000
System Description:
Arista Networks EOS version 0000.0000.0000 running on an Arista Networks DCS-7280SR2-48YC6
Time remaining: 114 seconds
System Capabilities: B,R
Enabled Capabilities: B,R
Management Addresses:
IP: 0000.0000.0000.61
Auto Negotiation - not supported
Physical media capabilities - not advertised
Media Attachment Unit type - not advertised
Vlan ID: - not advertised
------------------------------------------------
Chassis id: 0000.0000.0000
Port id: PORT
Port Description: DESC
System Name: HOST-0000.0000.0000
System Description:
Arista Networks EOS version 0000.0000.0000 running on an Arista Networks DCS-7280SR2-48YC6
Time remaining: 22 seconds
System Capabilities: B,R
Enabled Capabilities: B,R
Management Addresses:
IP: 0000.0000.0000.59
Auto Negotiation - not supported
Physical media capabilities - not advertised
Media Attachment Unit type - not advertised
Vlan ID: - not advertised
------------------------------------------------
Chassis id: 0000.0000.0000
Port id: 0/52
Port Description - not advertised
System Name - not advertised
System Description - not advertised
Time remaining: 91 seconds
System Capabilities - not advertised
Enabled Capabilities - not advertised
Management Addresses - not advertised
Auto Negotiation - not supported
Physical media capabilities - not advertised
Media Attachment Unit type - not advertised
Vlan ID: 0
------------------------------------------------
Chassis id: 0000.0000.0000
Port id: PORT
Port Description: DESC
System Name: HOST-0000.0000.0000.ca
System Description:
Cisco IOS Software, C3560 Software (C3560-IPBASEK9-M), Version 15.0(2)SE11, RELEASE SOFTWARE (fc3)
Technical Support: http://0000.0000.0000/techsupport
Copyright (c) 1986-2017 by Cisco Systems, Inc.
Compiled Sat 19-Aug-17 09:21 by prod_rel_team
Time remaining: 97 seconds
System Capabilities: B,R
Enabled Capabilities: B,R
Management Addresses:
IP: 0000.0000.0000.1
Auto Negotiation - supported, enabled
Physical media capabilities:
1000baseT(FD)
100base-TX(FD)
100base-TX(HD)
10base-T(FD)
10base-T(HD)
Media Attachment Unit type: 30
Vlan ID: 0
------------------------------------------------
Chassis id: 0000.0000.0000
Port id: PORT
Port Description: DESC
System Name: HOST-0000.0000.0000
System Description:
Cisco IOS Software, C3750E Software (C3750E-UNIVERSALK9-M), Version 15.0(2)SE6, RELEASE SOFTWARE (fc2)
Technical Support: http://0000.0000.0000/techsupport
Copyright (c) 1986-2014 by Cisco Systems, Inc.
Compiled Wed 09-Apr-14 02:55 by prod_rel_team
Time remaining: 91 seconds
System Capabilities: B,R
Enabled Capabilities: B
Management Addresses:
IP: 0000.0000.0000.201
Auto Negotiation - supported, enabled
Physical media capabilities:
1000baseT(FD)
100base-TX(FD)
100base-TX(HD)
10base-T(FD)
10base-T(HD)
Media Attachment Unit type: 30
Vlan ID: 0
------------------------------------------------
Chassis id: 0000.0000.0000
Port id: PORT
Port Description: DESC
System Name: HOST-0000.0000.0000
System Description:
Arista Networks EOS version 0000.0000.0000 running on an Arista Networks DCS-7280CR2A-30
Time remaining: 116 seconds
System Capabilities: B,R
Enabled Capabilities: B,R
Management Addresses:
IP: 0000.0000.0000.28
Auto Negotiation - not supported
Physical media capabilities - not advertised
Media Attachment Unit type - not advertised
Vlan ID: - not advertised
------------------------------------------------
Chassis id: ID
Port id: 0/0/x0
Port Description: DESC
System Name: HOST
System Description:
DESC
Time remaining: 35 seconds
System Capabilities: B
Enabled Capabilities: B
Management Addresses:
IP: 0000.0000.0000.122
Auto Negotiation - not supported
Physical media capabilities - not advertised
Media Attachment Unit type - not advertised
Vlan ID: - not advertised
------------------------------------------------
Chassis id: 0000.0000.0000
Port id: PORT
Port Description: PORT
System Name: HOST
System Description:
Cisco IOS Software, c7600s72033_rp Software (c7600s72033_rp-ADVIPSERVICESK9-M), Version 15.4(3)S3, RELEASE SOFTWARE (fc1)
Technical Support: http://0000.0000.0000/techsupport
Copyright (c) 1986-2015 by Cisco Systems, Inc.
Compiled Thu 28-May-15 06:30 by pr
Time remaining: 97 seconds
System Capabilities: B,R
Enabled Capabilities: B,R
Management Addresses:
IP: 0000.0000.0000.4
Auto Negotiation - not supported
Physical media capabilities - not advertised
Media Attachment Unit type - not advertised
Vlan ID: - not advertised
------------------------------------------------
Chassis id: 0000.0000.0000
Port id: PORT
Port Description - not advertised
System Name: HOST
System Description:
MikroTik RouterOS 0000.0000.0000 (stable) May/02/2022 15:18:17 CRS354-48G-4S+2Q+
Time remaining: 67 seconds
System Capabilities: B,R
Enabled Capabilities: B,R
Management Addresses - not advertised
Auto Negotiation - not supported
Physical media capabilities - not advertised
Media Attachment Unit type - not advertised
Vlan ID: - not advertised
------------------------------------------------
Chassis id: 0000.0000.0000
Port id: 0000.0000.0000
Port Description: DESC
System Name: HOST
System Description:
Brocade MLXe (System Mode: XMR), IronWare Version 0000.0000.0000 Compiled on Jul 6 2017 at 04:45:06 labeled as 0000.0000.0000
Time remaining: 95 seconds
System Capabilities: B,R
Enabled Capabilities: B,R
Management Addresses:
IP: 0000.0000.0000.8
Auto Negotiation - supported, disabled
Physical media capabilities - not advertised
Media Attachment Unit type: 35
Vlan ID: - not advertised
------------------------------------------------
Chassis id: 0000.0000.0000
Port id: 0000.0000.0000
Port Description: DESC
System Name: HOST
System Description:
Brocade MLXe (System Mode: XMR), IronWare Version 0000.0000.0000 Compiled on Jul 6 2017 at 04:45:06 labeled as 0000.0000.0000
Time remaining: 91 seconds
System Capabilities: B,R
Enabled Capabilities: B,R
Management Addresses:
IP: 0000.0000.0000.47
Auto Negotiation - supported, disabled
Physical media capabilities - not advertised
Media Attachment Unit type: 35
Vlan ID: - not advertised
------------------------------------------------
Chassis id: 0000.0000.0000
Port id: 0/49
Port Description - not advertised
System Name - not advertised
System Description - not advertised
Time remaining: 105 seconds
System Capabilities - not advertised
Enabled Capabilities - not advertised
Management Addresses - not advertised
Auto Negotiation - not supported
Physical media capabilities - not advertised
Media Attachment Unit type - not advertised
Vlan ID: 0
Total entries displayed: 20
I realized I did not provide the full output from get_lldp_neighbors
0000.0000.0000
00:00:00:00:00:00
0000.0000.0000
00:00:00:00:00:00
0000.0000.0000
00:00:00:00:00:00
0000.0000.0000
00:00:00:00:00:00
0000.0000.0000
00:00:00:00:00:00
0000.0000.0000
00:00:00:00:00:00
0000.0000.0000
00:00:00:00:00:00
0000.0000.0000
00:00:00:00:00:00
0000.0000.0000
00:00:00:00:00:00
0000.0000.0000
00:00:00:00:00:00
0000.0000.0000
00:00:00:00:00:00
0000.0000.0000
00:00:00:00:00:00
0000.0000.0000
00:00:00:00:00:00
0000.0000.0000
00:00:00:00:00:00
E7-2:SN00000000000
0000.0000.0000
00:00:00:00:00:00
0000.0000.0000
00:00:00:00:00:00
0000.0000.0000
00:00:00:00:00:00
0000.0000.0000
00:00:00:00:00:00
0000.0000.0000
00:00:00:00:00:00
00:00:00:00:00:00
00:00:00:00:00:00
0/51
2022-11-22 12:54:47,783 - napalm - ERROR - method - Failed: failed to detect EUI version: '0/51'
Then the traceback I posted above follows the above text.
Hi,
I found some time to look in to this.
In the above snippet, we pass the remote_port through the mac() helper function. For the device I'm encountering issues with this function on, the remote_port is seldom a MAC address. Hence why this fails.
As a workaround for myself, commenting this line allowed the get_lldp_neighbors()
function to run:
https://github.com/napalm-automation/napalm/blob/7ecb9b9a330579fc9669b92b2bb56ff54131e83a/napalm/ios/ios.py#L990
I suppose this function could be improved by checking to ensure the port
is indeed a MAC address.
e.g.) with a try, except.
I also noticed that the port
only gets formatted with the mac()
helper method in get_lldp_neighbors()
if line 988 is true, if not hostname
. Otherwise, it doesn't get formatted and remains as hhhh.hhhh.hhhh
.
Likewise, the get_lldp_neighbors_detail()
method does not format the port
as a MAC.
I'm not sure what the intended functionality is here. Maybe I don't understand something, but it appears inconsistent.
I haven't seen the show lldp neighbor detail
output from many Cisco devices. I can only imagine that those who have written and contributed to this specific function have seen the output of show lldp neighbor detail
from many Cisco devices.
I think it's interesting that the assumed output of the remote port is a MAC address, and I just happen to have a device with unexpected output, but that it only matters if the if no hostname
logic is true
.
Description of Issue/Question
Note: Please check https://guides.github.com/features/mastering-markdown/ to see how to properly format your request.
Did you follow the steps from https://github.com/napalm-automation/napalm#faq
(Place an
x
between the square brackets where applicable)Setup
napalm version
(Paste verbatim output from
pip freeze | grep napalm
between quotes below)Network operating system version
(Paste verbatim output from
show version
- or equivalent - between quotes below)Steps to Reproduce the Issue
Run the following command when one of the rows within the Compatibility column is blank.
Error Traceback
(Paste the complete traceback of the exception between quotes below)
Full CLI output of "show lldp neighbors"
Note: HOSTNAME indicates a hostname I've removed. 0000.0000.0000 indicates a mac address originally formatted as three groups of four, whose specifics I've removed. I've included as much of the original formatting as is applicable to the above error message.