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

BugFix: (IOS) - show cdp neighbors detail - Prevent capturing trailing whitespace for capabilities #684

Merged
merged 2 commits into from
May 5, 2020
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
8 changes: 5 additions & 3 deletions templates/cisco_ios_show_cdp_neighbors_detail.textfsm
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ Value PLATFORM (.*)
Value REMOTE_PORT (.*)
Value LOCAL_PORT (.*)
Value SOFTWARE_VERSION (.*$)
Value CAPABILITIES (.*)
Value CAPABILITIES (.+?)

Start
^Device ID: ${DESTINATION_HOST}
^Entry address\(es\)\s*:\s* -> ParseIP
^Platform\s*:\s*${PLATFORM}\s*,\s*Capabilities\s*:\s*${CAPABILITIES}
^Platform\s*:\s*${PLATFORM}\s*,\s*Capabilities\s*:\s*${CAPABILITIES}\s+$$
^Platform\s*:\s*${PLATFORM}\s*,\s*Capabilities\s*:\s*${CAPABILITIES}$$
^Interface: ${LOCAL_PORT}, Port ID \(outgoing port\): ${REMOTE_PORT}
^Version : -> GetVersion
# Capture time-stamp if vty line has command time-stamping turned on
Expand All @@ -18,7 +19,8 @@ Start

ParseIP
^.*IP address: ${MANAGEMENT_IP} -> Start
^Platform\s*:\s*${PLATFORM}\s*,\s*Capabilities\s*:\s*${CAPABILITIES} -> Start
^Platform\s*:\s*${PLATFORM}\s*,\s*Capabilities\s*:\s*${CAPABILITIES}\s+$$ -> Start
^Platform\s*:\s*${PLATFORM}\s*,\s*Capabilities\s*:\s*${CAPABILITIES}$$ -> Start
^.* -> Start

GetVersion
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Device ID: switchxxxxx
Entry address(es):
IP address: 1.1.1.1
Platform: cisco WS-C3560X-24P, Capabilities: Switch IGMP
Interface: GigabitEthernet0/3, Port ID (outgoing port): GigabitEthernet0/8
Holdtime : 154 sec

Version :
Cisco IOS Software, C3560E Software (C3560E-UNIVERSALK9-M), Version 12.2(55)SE10, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2015 by Cisco Systems, Inc.
Compiled Wed 11-Feb-15 11:28 by prod_rel_team

advertisement version: 2
Protocol Hello: OUI=0x00000C, Protocol ID=0x0112; payload len=27, value=00000000FFFFFFFF010221FF00000000000000C88BC41880FF0000
VTP Management Domain: ''
Native VLAN: 1
Duplex: full
Power Available TLV:

Power request id: 0, Power management id: 1, Power available: 0, Power management level: -1
Management address(es):
IP address: 1.1.1.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
parsed_sample:
- destination_host: "switchxxxxx"
management_ip: "1.1.1.1"
platform: "cisco WS-C3560X-24P"
remote_port: "GigabitEthernet0/8"
local_port: "GigabitEthernet0/3"
software_version: "Cisco IOS Software, C3560E Software (C3560E-UNIVERSALK9-M),\
\ Version 12.2(55)SE10, RELEASE SOFTWARE (fc2)"
capabilities: "Switch IGMP"