Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve LLDP neighbor detail parsing on older IOS versions #846

Merged
merged 2 commits into from
Oct 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ Value REMOTE_SYSTEM_CAPAB (.*)
Value REMOTE_SYSTEM_ENABLE_CAPAB (.*)

Start
# A line of hyphens delimits neighbor records
^------+ -> Record Neighbor

Neighbor
^Local Intf\s*?[:-]\s+${LOCAL_INTERFACE}
^Chassis id\s*?[:-]\s+${REMOTE_CHASSIS_ID}
^Port id\s*?[:-]\s+${REMOTE_PORT}
Expand All @@ -25,4 +21,4 @@ Neighbor

Description
# Capture the entire line and go back to Neighbor state
^${REMOTE_SYSTEM_DESCRIPTION} -> Neighbor
^${REMOTE_SYSTEM_DESCRIPTION} -> Start
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"GigabitEthernet0/24": [
{
"parent_interface": "N/A",
"remote_chassis_id": "f4a7.39cd.2e40",
"remote_port": "ge-0/0/23",
"remote_port_description": "ptp to switch",
"remote_system_capab": "B,R",
"remote_system_description": "Juniper Networks, Inc. ex3300-24p , version 12.3R12.4 Build date: 2016-01-20 05:03:06 UTC",
"remote_system_enable_capab": "B,R",
"remote_system_name": "switch1"
}
],
"GigabitEthernet0/1": [
{
"parent_interface": "N/A",
"remote_chassis_id": "a8b1.d41d.8680",
"remote_port": "Gi0/2",
"remote_port_description": "GigabitEthernet0/2",
"remote_system_capab": "B",
"remote_system_description": "Cisco IOS Software, C2960 Software (C2960-LANBASEK9-M), Version 15.0(1)SE2, RELEASE SOFTWARE (fc3)",
"remote_system_enable_capab": "B",
"remote_system_name": "switch2"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

Capability codes:
(R) Router, (B) Bridge, (T) Telephone, (C) DOCSIS Cable Device
(W) WLAN Access Point, (P) Repeater, (S) Station, (O) Other

Device ID Local Intf Hold-time Capability Port ID
switch1 Gi0/24 120 B,R ge-0/0/23
switch2 Gi0/1 120 B Gi0/2

Total entries displayed: 2

Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@


Chassis id: f4a7.39cd.2e40
Port id: ge-0/0/23
Port Description: ptp to switch
System Name: switch1

System Description:
Juniper Networks, Inc. ex3300-24p , version 12.3R12.4 Build date: 2016-01-20 05:03:06 UTC

Time remaining: 105 seconds
System Capabilities: B,R
Enabled Capabilities: B,R
Management Addresses - not advertised
Auto Negotiation - supported, enabled
Physical media capabilities:
Other/unknown
100base-TX(HD)
Symm Pause(FD)
Symm, Asym Pause(FD)
1000baseX(FD)
1000baseT(HD)
Media Attachment Unit type - not advertised

MED Information:

MED Codes:
(NP) Network Policy, (LI) Location Identification
(PS) Power Source Entity, (PD) Power Device
(IN) Inventory

Inventory information - not advertised
Capabilities: NP, LI, PS
Device type: Network connectivity
Network Policies - not advertised
Power requirements - not advertised
---------------------------------------------


Chassis id: a8b1.d41d.8680
Port id: Gi0/2
Port Description: GigabitEthernet0/2
System Name: switch2

System Description:
Cisco IOS Software, C2960 Software (C2960-LANBASEK9-M), Version 15.0(1)SE2, RELEASE SOFTWARE (fc3)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2011 by Cisco Systems, Inc.
Compiled Thu 22-Dec-11 00:46 by prod_rel_team

Time remaining: 115 seconds
System Capabilities: B
Enabled Capabilities: B
Management Addresses:
IP: 10.10.10.10
Auto Negotiation - supported, enabled
Physical media capabilities:
Other/unknown
Symm Pause(FD)
Symm, Asym Pause(FD)
1000baseX(FD)
1000baseT(HD)
Media Attachment Unit type: 30
---------------------------------------------


Total entries displayed: 2