Skip to content
Open
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
@@ -1,27 +1,95 @@
Value Required NEIGHBOR_NAME (\S+)
Value MGMT_ADDRESS (\d+\.\d+\.\d+\.\d+|\w+\.\w+\.\w+)
Value List INTERFACE_IPV6 ([0-9a-fA-F:]+)
Value MGMT_IP_ADDRESS (\d+\.\d+\.\d+\.\d+)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to keep the MGMT_ADDRESS in lock step with LLDP neighbor outputs as well. So that these remain consistent across neighbor templates.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to keep the MGMT_ADDRESS in lock step with LLDP neighbor outputs as well. So that these remain consistent across neighbor templates.

I have reverted the breaking changes. At least the naming is not critical.

Value PLATFORM (.*)
Value NEIGHBOR_INTERFACE (.*)
Value LOCAL_INTERFACE (.*)
Value NEIGHBOR_DESCRIPTION (.*$)
Value CAPABILITIES (.+?)
Value SOFTWARE_VERSION ([^,\s]+)
Value SOFTWARE (.*)
Value SOFTWARE_FAMILY (.*)
Value List VERSION (\S.*)
Value SERIAL (\S+)
Value VTP_DOMAIN (.+)
Value VTP_VERSION (\d+)
Value NATIVE_VLAN (\d+)
Value DUPLEX (\S+)
Value DUPLEX_MISMATCH (\S+)
Value HOLDTIME (\d+)
Value POWER_DRAWN ([.\d]+)
Value POWER_REQUEST_ID ([-\d]+)
Value POWER_REQUEST_LEVEL ([-\d\s]+)
Value POWER_MGMT_ID ([-\d]+)
Value POWER_AVAILABLE ([-\d]+)
Value POWER_MGMT_LEVEL ([-\d]+)
Value PEER_MAC (\S+\.\S+\.\S+)
Value UNIDIRECTIONAL_MODE (\S+)

Start
^Device ID: ${NEIGHBOR_NAME}
^Entry address\(es\)\s*:\s* -> ParseIP
^Platform\s*:\s*${PLATFORM}\s*,\s*Capabilities\s*:\s*${CAPABILITIES}\s+$$
^Platform\s*:\s*${PLATFORM}\s*,\s*Capabilities\s*:\s*${CAPABILITIES}$$
^Interface: ${LOCAL_INTERFACE}, Port ID \(outgoing port\): ${NEIGHBOR_INTERFACE}
^Version : -> GetVersion
# Nexus Neighbor provides Serial Number
^Device ID\s*:\s*${NEIGHBOR_NAME}\s*\(${SERIAL}\)\s*$$
^Device ID\s*:\s*${NEIGHBOR_NAME}\s*$$
^Entry address\(es\)\s*:\s*$$ -> ParseIP
^\s*Platform\s*:\s*${PLATFORM}\s*,\s*Capabilities\s*:\s*${CAPABILITIES}\s*$$
^Interface:\s*${LOCAL_INTERFACE}\s*,\s*Port ID\s*\(outgoing port\)\s*:\s*${NEIGHBOR_INTERFACE}\s*$$
# For Compatibility preserve the legacy format
^Version\s*:\s*$$ -> GetVersion
^Version\s*:\s*$$ -> NewVersion
# Various optional parameters
^advertisement\s+version\s*:\s*${VTP_VERSION}\s*$$
^Peer\s*Source\s*MAC:\s*${PEER_MAC}\s*$$
^VTP Management Domain\s*:\s*${VTP_DOMAIN}\s*$$
^Native VLAN\s*:\s*${NATIVE_VLAN}\s*$$
^\s*Duplex\s*:\s*${DUPLEX}\s*\(\s*${DUPLEX_MISMATCH}\s*\)\s*$$
^\s*Duplex\s*:\s*${DUPLEX}\s*$$
^Power\s*drawn:\s*${POWER_DRAWN}\s*Watts$$
# Management Address may be different of interface - global address
^Management address\(es\)\s*:\s*$$ -> ParseMgmtIP
# PoE information
^\s*Power\s*Available\s*TLV\s*:\s*$$ -> PwrAvail
^\s*Power\s*request\s*id\s*:\s*${POWER_REQUEST_ID}\s*,\s*Power\s*management\s*id\s*:\s*${POWER_MGMT_ID}\s*$$
^\s*Power\s*request\s*levels\s*are\s*:\s*${POWER_REQUEST_LEVEL}\s*$$
^Holdtime\s*:\s*${HOLDTIME}\s*sec
^Unidirectional\s*Mode\s*:\s*${UNIDIRECTIONAL_MODE}\s*$$
# Additionnal parameters - noise
^advertisement version\s*:
^Protocol\s+Hello
# Capture time-stamp if vty line has command time-stamping turned on
^Load\s+for\s+
^Load\s+for
^Time\s+source\s+is
^-+$$ -> Record Start
^$$ -> Start
^Total\s*cdp\s*entries\s*displayed\s*:
^. -> Error

ParseIP
^.*IP address: ${MGMT_ADDRESS} -> 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
# Parse Management IP - unfortunately no clear separator with the rest of the record
^\s*IP address:\s*${MGMT_ADDRESS}\s*$$
^\s*IPv6 address:\s*${INTERFACE_IPV6}\s*\(.*\)\s*$$
^\s*Platform\s*:\s*${PLATFORM}\s*,\s*Capabilities\s*:\s*${CAPABILITIES}\s*$$ -> Start

GetVersion
^${NEIGHBOR_DESCRIPTION} -> Record Start
# For compatibility with legacy templates
^${NEIGHBOR_DESCRIPTION} -> NewVersion
# Match software line with version info for Cisco Devices

NewVersion
# Parse directly relevant information of the version of the software
^\s*${SOFTWARE}\s*,\s*${SOFTWARE_FAMILY}\s*,\s*[^,]*\bVersion\s*:?\s*${SOFTWARE_VERSION}\s*,*\s*.*$$
^\s*${SOFTWARE}\s*,*\s*${SOFTWARE_FAMILY}\s*,*s*[^,]*\bVersion\s*:?\s*${SOFTWARE_VERSION}\s*,*\s*.*$$
# get whatever is provided
^${VERSION}
^\s*$$ -> Start


ParseMgmtIP
^\s*IP address:\s*${MGMT_IP_ADDRESS}\s*$$ -> Start
^$$ -> Start

PwrAvail
# Optional: tolerate blank lines or unrelated lines after the header without failing.
^\s*$$ -> PwrAvail
# Match the detail line (allow indentation and flexible spaces/commas).
^\s*Power\s*request\s*id\s*:\s*${POWER_REQUEST_ID}\s*,\s*Power\s*management\s*id\s*:\s*${POWER_MGMT_ID}\s*,\s*Power\s*available\s*:\s*${POWER_AVAILABLE}\s*,\s*Power\s*management\s*level\s*:\s*${POWER_MGMT_LEVEL}\s*$$ -> Start
2 changes: 1 addition & 1 deletion ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ cisco_ios_show_interface_transceiver.textfsm, .*, cisco_ios, sh[[ow]] int[[erfac
cisco_ios_show_interfaces_switchport.textfsm, .*, cisco_ios, sh[[ow]] int[[erfaces]](?: (?:\S+))? sw[[itchport]]
cisco_ios_show_ip_http_server_status.textfsm, .*, cisco_ios, sh[[ow]] ip http ser[[ver]] statu[[s]]
cisco_ios_show_lldp_neighbors_detail.textfsm, .*, cisco_ios, sh[[ow]] lld[[p]] neig[[hbors]] det[[ail]]
cisco_ios_show_cdp_neighbors_detail.textfsm, .*, cisco_ios, sh[[ow]] c[[dp]] neig[[hbors]] det[[ail]]
cisco_ios_show_cdp_neighbors_detail.textfsm, .*, cisco_ios, sh[[ow]] c[[dp]] nei[[ghbors]] det[[ail]]
cisco_ios_show_etherchannel_summary.textfsm, .*, cisco_ios, sh[[ow]] etherchann[[el]] summ[[ary]]
cisco_ios_show_ipv6_interface_brief.textfsm, .*, cisco_ios, sh[[ow]] ipv[[6]] i[[nterface]] b[[rief]]
cisco_ios_show_ip_nat_translations.textfsm, .*, cisco_ios, sh[[ow]] ip nat translation[[s]]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,35 +1,123 @@
---
parsed_sample:
- capabilities: "Switch IGMP"
duplex: "full"
duplex_mismatch: ""
holdtime: "164"
interface_ipv6: []
local_interface: "GigabitEthernet1/0/16"
mgmt_address: "10.1.1.2"
neighbor_description: "Cisco IOS Software, C2960 Software (C2960-LANBASEK9-M),\
\ Version 12.2(55)SE9, RELEASE SOFTWARE (fc1)"
mgmt_ip_address: "10.1.1.2"
native_vlan: "1"
neighbor_description: "Cisco IOS Software, C2960 Software (C2960-LANBASEK9-M), Version 12.2(55)SE9, RELEASE SOFTWARE (fc1)"
neighbor_interface: "GigabitEthernet0/1"
neighbor_name: "desktop-switch"
peer_mac: ""
platform: "cisco WS-C2960-8TC-L"
power_available: ""
power_drawn: ""
power_mgmt_id: ""
power_mgmt_level: ""
power_request_id: ""
power_request_level: ""
serial: ""
software: ""
software_family: ""
software_version: ""
unidirectional_mode: ""
version:
- "Technical Support: http://www.cisco.com/techsupport"
- "Copyright (c) 1986-2014 by Cisco Systems, Inc."
- "Compiled Mon 03-Mar-14 22:53 by prod_rel_team"
vtp_domain: "''"
vtp_version: "2"
- capabilities: "Router Switch IGMP"
duplex: "full"
duplex_mismatch: ""
holdtime: "156"
interface_ipv6: []
local_interface: "GigabitEthernet1/0/22"
mgmt_address: "10.1.1.1"
neighbor_description: "Cisco IOS Software, 3800 Software (C3825-ADVENTERPRISEK9-M),\
\ Version 12.4(24)T1, RELEASE SOFTWARE (fc3)"
mgmt_ip_address: ""
native_vlan: ""
neighbor_description: "Cisco IOS Software, 3800 Software (C3825-ADVENTERPRISEK9-M), Version 12.4(24)T1, RELEASE SOFTWARE (fc3)"
neighbor_interface: "GigabitEthernet0/0"
neighbor_name: "ce-router"
peer_mac: ""
platform: "Cisco 3825"
power_available: ""
power_drawn: ""
power_mgmt_id: ""
power_mgmt_level: ""
power_request_id: ""
power_request_level: ""
serial: ""
software: ""
software_family: ""
software_version: ""
unidirectional_mode: ""
version:
- "Technical Support: http://www.cisco.com/techsupport"
- "Copyright (c) 1986-2009 by Cisco Systems, Inc."
- "Compiled Fri 19-Jun-09 18:40 by prod_rel_team"
vtp_domain: "''"
vtp_version: "2"
- capabilities: "Host"
duplex: "full"
duplex_mismatch: ""
holdtime: "145"
interface_ipv6: []
local_interface: "GigabitEthernet1/0/19"
mgmt_address: "10.1.1.232"
neighbor_description: "Linux 2.6.32-431.20.3.el6.x86_64 #1 SMP Fri Jun 6 18:30:54\
\ EDT 2014 CCM:10.5.2.10000-5.i386"
mgmt_ip_address: ""
native_vlan: ""
neighbor_description: "Linux 2.6.32-431.20.3.el6.x86_64 #1 SMP Fri Jun 6 18:30:54 EDT 2014 CCM:10.5.2.10000-5.i386"
neighbor_interface: "eth0"
neighbor_name: "server"
peer_mac: ""
platform: "VMware"
power_available: ""
power_drawn: ""
power_mgmt_id: ""
power_mgmt_level: ""
power_request_id: ""
power_request_level: ""
serial: ""
software: ""
software_family: ""
software_version: ""
unidirectional_mode: ""
version: []
vtp_domain: ""
vtp_version: "2"
- capabilities: "Router Switch IGMP"
duplex: "full"
duplex_mismatch: ""
holdtime: "173"
interface_ipv6: []
local_interface: "GigabitEthernet0/3"
mgmt_address: ""
neighbor_description: "Cisco IOS Software, vios_l2 Software (vios_l2-ADVENTERPRISEK9-M),\
\ Version 15.2(CML_NIGHTLY_20150414)FLO_DSGS7, EARLY DEPLOYMENT DEVELOPMENT\
\ BUILD, synced to DSGS_PI5_POSTCOLLAPSE_TEAM_TRACK_CLONE"
mgmt_ip_address: ""
native_vlan: "1"
neighbor_description: "Cisco IOS Software, vios_l2 Software (vios_l2-ADVENTERPRISEK9-M), Version 15.2(CML_NIGHTLY_20150414)FLO_DSGS7, EARLY DEPLOYMENT DEVELOPMENT BUILD, synced to DSGS_PI5_POSTCOLLAPSE_TEAM_TRACK_CLONE"
neighbor_interface: "GigabitEthernet0/3"
neighbor_name: "vIOS-L2-1"
peer_mac: ""
platform: "Cisco "
power_available: ""
power_drawn: ""
power_mgmt_id: ""
power_mgmt_level: ""
power_request_id: ""
power_request_level: ""
serial: ""
software: ""
software_family: ""
software_version: ""
unidirectional_mode: ""
version:
- "Technical Support: http://www.cisco.com/techsupport"
- "Copyright (c) 1986-2015 by Cisco Systems, Inc."
- "Compiled Wed 15-Apr-15 00:42 by mmen"
vtp_domain: ""
vtp_version: "2"
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
---
parsed_sample:
- capabilities: "Switch IGMP"
duplex: "full"
duplex_mismatch: ""
holdtime: "154"
interface_ipv6: []
local_interface: "GigabitEthernet0/3"
mgmt_address: "1.1.1.1"
neighbor_description: "Cisco IOS Software, C3560E Software (C3560E-UNIVERSALK9-M),\
\ Version 12.2(55)SE10, RELEASE SOFTWARE (fc2)"
mgmt_ip_address: "1.1.1.1"
native_vlan: "1"
neighbor_description: "Cisco IOS Software, C3560E Software (C3560E-UNIVERSALK9-M), Version 12.2(55)SE10, RELEASE SOFTWARE (fc2)"
neighbor_interface: "GigabitEthernet0/8"
neighbor_name: "switchxxxxx"
peer_mac: ""
platform: "cisco WS-C3560X-24P"
power_available: "0"
power_drawn: ""
power_mgmt_id: "1"
power_mgmt_level: "-1"
power_request_id: "0"
power_request_level: ""
serial: ""
software: ""
software_family: ""
software_version: ""
unidirectional_mode: ""
version:
- "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"
vtp_domain: "''"
vtp_version: "2"
Loading