Skip to content

Commit

Permalink
BugFix: IOS CDP - Better handling of output (networktocode#735)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcgill298 authored Jun 5, 2020
1 parent e4e6f5b commit 966b406
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
10 changes: 5 additions & 5 deletions templates/cisco_ios_show_cdp_neighbors.textfsm
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Value Required NEIGHBOR (\S+)
Value LOCAL_INTERFACE (\S+(?:\s\S+)?)
Value CAPABILITY ((?:\w\s*?)*?)
Value PLATFORM (\S{2,}\s\S+|\S{2,})
Value NEIGHBOR_INTERFACE ([a-zA-Z]\S+(?:\s\S+)?)
Value CAPABILITY ((?:\w\s)*\w)
Value PLATFORM ((?:[IiPp]{2}\s)?\S+)
Value NEIGHBOR_INTERFACE (.+?)

Start
^Device.*ID -> CDP
Expand All @@ -12,5 +12,5 @@ Start

CDP
^${NEIGHBOR}$$
^\s*${LOCAL_INTERFACE}\s+\d+\s+${CAPABILITY}\s*${PLATFORM}\s+${NEIGHBOR_INTERFACE} -> Record
^${NEIGHBOR}\s+${LOCAL_INTERFACE}\s+\d+\s+${CAPABILITY}\s*${PLATFORM}\s+${NEIGHBOR_INTERFACE} -> Record
^\s*${LOCAL_INTERFACE}\s+\d+\s+${CAPABILITY}\s+${PLATFORM}\s+${NEIGHBOR_INTERFACE}\s*$$ -> Record
^${NEIGHBOR}\s+${LOCAL_INTERFACE}\s+\d+\s+${CAPABILITY}\s+${PLATFORM}\s+${NEIGHBOR_INTERFACE}\s*$$ -> Record
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ SEP00000000000C Gig 1/0/24 164 H P M IP Phone Port 1
SEP00000000000D Gig 1/0/9 176 H P M IP Phone Port 1
SEP00000000000E Gig 1/0/17 131 H P M IP Phone Port 1
SEP00000000000F Gig 1/0/20 136 H P M IP Phone Port 1
SEP000000000010 Gig 1/0/36 162 H P M IP Phone Port 1
SEP000000000010 Gig 1/0/36 162 H P M IP Phone Port 1

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,
D - Remote, C - CVTA, M - Two-port Mac Relay

Device ID Local Intrfce Holdtme Capability Platform Port ID
acc-sw101
Ten 3/7 175 R AS5610-52 0/47

Total cdp entries displayed : 1

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
parsed_sample:
- neighbor: "acc-sw101"
local_interface: "Ten 3/7"
capability: "R"
platform: "AS5610-52"
neighbor_interface: "0/47"

0 comments on commit 966b406

Please sign in to comment.