Skip to content

Commit

Permalink
IOS SHOW LLDP NEIGHBORS: Fixes #375 (#376)
Browse files Browse the repository at this point in the history
Fix template not accounting for neighbor name running into interface name.

TEMPLATE UPDATES:
  - Limit `NEIGHBOR` capture group to first 20 non-space characters.
  - Change space capture from being required to being allowed

TEST UPDATES:
  - Add new raw/parsed files to account for additional output
  • Loading branch information
jvanderaa authored and jmcgill298 committed Feb 25, 2019
1 parent 274bb51 commit a5f1bd5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/cisco_ios_show_lldp_neighbors.template
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Value Required NEIGHBOR (\S+)
Value Required NEIGHBOR (\S{0,20})
Value Required LOCAL_INTERFACE (\S+)
Value Required NEIGHBOR_INTERFACE (\S+)

Start
^Device.*ID -> LLDP

LLDP
^${NEIGHBOR}\s+${LOCAL_INTERFACE}\s+\d+\s+(\S+)*\s+${NEIGHBOR_INTERFACE} -> Record
^${NEIGHBOR}\s*${LOCAL_INTERFACE}\s+\d+\s+(\S+)*\s+${NEIGHBOR_INTERFACE} -> Record
^${NEIGHBOR}
^\s+${LOCAL_INTERFACE}\s+\d+\s+(\S+)*\s+${NEIGHBOR_INTERFACE} -> Record
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
parsed_sample:
- neighbor: "long_name_swt.josh-v"
local_interface: "Gi0/2"
neighbor_interface: "Gi0/0"
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
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
long_name_swt.josh-vGi0/2 120 R Gi0/0

Total entries displayed: 1

0 comments on commit a5f1bd5

Please # to comment.