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

Normalize CDP, LLDP, ISDP capture groups #1469

Merged
merged 41 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
1924226
replace LOCAL_PORT with LOCAL_INTERFACE in CDP/LLDP templates to
mjbear Sep 2, 2023
5f308ec
replace REMOTE_PORT with NEIGHBOR_INTERFACE in CDP/LLDP templates to
mjbear Sep 2, 2023
140f96f
add LOCAL_INTERFACE to data_model.md
mjbear Sep 2, 2023
d341a2f
add NEIGHBOR_INTERFACE to data_model.md and reformat
mjbear Sep 2, 2023
d03578d
replace NEIGHBOR_PORT with NEIGHBOR_INTERFACE in
mjbear Sep 2, 2023
0478a2c
replace PORT_INFO with NEIGHBOR_INTERFACE for
mjbear Sep 2, 2023
5eba71f
replace SYSTEM_CAPABILITIES_SUPPORTED with CAPABILITIES_SUPPORTED in
mjbear Sep 2, 2023
60f3e40
replace several capture groups for broadcom_icos_show_isdp_neighbors to
mjbear Sep 2, 2023
3bd1723
replace CAPABILITY with CAPABILITIES to normalize across CDP/LLDP
mjbear Sep 2, 2023
ca2928b
replace SYSTEM_CAPABILITIES_ENABLED with CAPABILITIES for
mjbear Sep 2, 2023
10c45a8
replace NEIGHBOR_CAPABILITY with CAPABILITIES for
mjbear Sep 2, 2023
3c052ac
replace capabilities and neighbor interface capture groups for
mjbear Sep 2, 2023
6049fdb
correct swapped capture groups in hp_comware_display_lldp_neighbor-in…
mjbear Sep 2, 2023
93b0318
replace NEIGHBOR_INTERFACE_DESCR with NEIGHBOR_INTERFACE_DESCRIPTION …
mjbear Sep 3, 2023
cc709b5
replace PORT_DESCR with NEIGHBOR_INTERFACE_DESCRIPTION in
mjbear Sep 3, 2023
aed8d72
replace several capture groups in arista_eos_show_lldp_neighbors_detail
mjbear Sep 3, 2023
cc8958a
replace DEST_HOST and DESTINATION_HOST with CHASSIS_ID (and some inst…
mjbear Sep 3, 2023
4428287
replace DEVICE_ID with CHASSIS_ID in cisco_s300_show_lldp_neighbors to
mjbear Sep 3, 2023
ca224b5
replace NEIGHBOR_ID with CHASSIS_ID in
mjbear Sep 3, 2023
941b6fd
replace NEIGHBOR_CHASSIS_ID with CHASSIS_ID and PVID with VLAN_ID in
mjbear Sep 3, 2023
a6b592a
replace NEIGHBOR with NEIGHBOR_NAME in several CDP and LLDP templates to
mjbear Sep 3, 2023
daa0c5b
replace SYSTEM_NAME with NEIGHBOR_NAME to normalize
mjbear Sep 3, 2023
2488810
replace NEIGHBOR_SYSNAME with NEIGHBOR_NAME in two hp_procurve LLDP
mjbear Sep 3, 2023
ec7033b
replace CHASSIS_NAME with NEIGHBOR_NAME in
mjbear Sep 3, 2023
038311a
normalize hp_procurve_show_lldp_info_remote-device with other CDP or
mjbear Sep 3, 2023
eb18958
normalize hp_procurve_show_lldp_info_remote-device_detail with other CDP
mjbear Sep 3, 2023
2d260f1
normalize aruba_aoscx_show_lldp_neighbors-info_detail with other CDP or
mjbear Sep 3, 2023
4396e50
replace SYSTEM_DESCRIPTION with NEIGHBOR_DESCRIPTION to normalize cis…
mjbear Sep 3, 2023
0f2f207
replace SYSTEM_DESCRIPTION with NEIGHBOR_DESCRIPTION to normalize cis…
mjbear Sep 3, 2023
e0fd61b
replace SYSTEM_DESCRIPTION with NEIGHBOR_DESCRIPTION to normalize hua…
mjbear Sep 3, 2023
2169e2f
- normalize PLATFORM_VERSION with NEIGHBOR_DESCRIPTION in arista_eos_…
mjbear Sep 3, 2023
7ff4ea5
- replace NEIGHBOR_VERSION with NEIGHBOR_DESCRIPTION in hp_procurve_s…
mjbear Sep 3, 2023
b5ce002
replace NEIGHBOR_CHASSIS_ID with CHASSIS_ID in
mjbear Sep 3, 2023
aa6bd87
- replace NEIGHBOR_PLATFORM with PLATFORM in hp_procurve_show_cdp_nei…
mjbear Sep 3, 2023
e0eaf30
replace MANUFACTURER_NAME with MANUFACTURER in
mjbear Sep 3, 2023
582c9f6
normalize management address capture groups in CDP/LLDP templates
mjbear Sep 4, 2023
84c78ee
replace NEIGHBOR_ADDRESS with MGMT_ADDRESS in hp_procurve_show_cdp_ne…
mjbear Sep 4, 2023
cacafd0
replace PORT_ID with NEIGHBOR_INTERFACE in
mjbear Sep 4, 2023
e46532a
normalize and capitalize capture groups in brocade_fastiron and
mjbear Sep 4, 2023
bd68a8d
couple more fixes to normalize
mjbear Sep 4, 2023
fb98a56
fixing failed local merge in regard to huawei_vrp lldp
mjbear Jan 7, 2024
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
70 changes: 40 additions & 30 deletions docs/dev/data_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,43 @@ Example: Imagine the extra programming logic needed to consume structured data w

# Common Capture Groups

| Capture Group | Usage Description |
|---------------------------|:------------------|
| `BIA` | use this if the template already has MAC_ADDRESS in use for the active MAC address |
| `BUNDLE_NAME` | virtual interface name for etherchannel, LACP, LAG, or port-channel interfaces |
| `BUNDLE_PROTOCOL` | virtual interface protocol type (LACP, PAgP) for etherchannel or port-channel interfaces |
| `BUNDLE_PROTOCOL_STATE` | virtual interface protocol state for etherchannel or port-channel interfaces |
| `BUNDLE_STATUS` | virtual interface status for etherchannel, LACP, LAG, or port-channel interfaces |
| `DESCRIPTION` | often used for port or interface descriptions |
| `GATEWAY` | gateway address for a subnet |
| `INTERFACE` | full word instead of IFACE, INTF, INTFC, etc |
| `IP_ADDRESS` | for a single IP address, often IPv4 |
| `IP_ADDRESSES` | for lists of IPv4 addresses, but in the case of some templates there may be a mix of IP protocol versions |
| `IP_HELPER` | for lists DHCP IP helper addresses |
| `IP_VERSION` | Internet Protocol (IP) version in the case of multiple versions appearing in output (use where necessary) |
| `IPV6_ADDRESS` | for a single IPv6 address |
| `IPV6_ADDRESSES` | for lists of IPv6 addresses |
| `IPV6_GATEWAY` | for IPv6 gateway address |
| `LOCAL_IP_ADDRESS` | local IP address in the case of First Hop Redundancy Protocols (FHRP)
| `MAC_ADDRESS` | instead of MAC or MACADDR |
| `MEMBER_INTERFACE` | list of physical member interface names that are bundled to make an etherchannel, LACP, LAG, or port-channel interface |
| `MEMBER_INTERFACE_STATUS` | list of member interface statuses for an etherchannel, LACP, LAG, or port-channel interface |
| `MGMT_IP_ADDRESS` | instead of MGMT_IP or MGMT_ADDRESS or MANAGEMENT_IP or REMOTE_MANAGEMENT_ADDRESS |
| `NEIGHBOR_ID` | for router IDs remote to the system being parsed |
| `NETMASK` | for IPv4 dotted quad masks |
| `NETWORK` | for network numbers or subnet address (without the mask or prefix/slash notation); in place of ROUTE |
| `PREFIX_LENGTH` | instead of PREFIX or CIDR for the numbers of a slash notation or CIDR mask |
| `PROTOCOL` | instead of PROTO |
| `ROUTER_ID` | for local router IDs (local to the device being parsed) |
| `VLAN_ID` | instead of VLAN or TAG |
| `VLAN_NAME` | VLAN name or description |
| Capture Group | Usage Description |
|----------------------------------|:------------------|
| `BIA` | use this if the template already has MAC_ADDRESS in use for the active MAC address |
| `BUNDLE_NAME` | virtual interface name for etherchannel, LACP, LAG, or port-channel interfaces |
| `BUNDLE_PROTOCOL` | virtual interface protocol type (LACP, PAgP) for etherchannel or port-channel interfaces |
| `BUNDLE_PROTOCOL_STATE` | virtual interface protocol state for etherchannel or port-channel interfaces |
| `BUNDLE_STATUS` | virtual interface status for etherchannel, LACP, LAG, or port-channel interfaces |
| `CAPABILITIES` | often represents active/operational neighbor capabilities shared via CDP or LLDP |
| `CAPABILITIES_SUPPORTED` | often represents supported neighbor capabilities shared via CDP or LLDP |
| `CHASSIS_ID` | often represents CDP or LLDP neighbor chassis ID |
| `DESCRIPTION` | often used for port or interface descriptions |
| `GATEWAY` | gateway address for a subnet |
| `INTERFACE` | full word instead of IFACE, INTF, INTFC, etc |
| `IP_ADDRESS` | for a single IP address, often IPv4 |
| `IP_ADDRESSES` | for lists of IPv4 addresses, but in the case of some templates there may be a mix of IP protocol versions |
| `IP_HELPER` | for lists DHCP IP helper addresses |
| `IP_VERSION` | Internet Protocol (IP) version in the case of multiple versions appearing in output (use where necessary) |
| `IPV6_ADDRESS` | for a single IPv6 address |
| `IPV6_ADDRESSES` | for lists of IPv6 addresses |
| `IPV6_GATEWAY` | for IPv6 gateway address |
| `LOCAL_INTERFACE` | often represents local interface or port for CDP or LLDP |
| `LOCAL_IP_ADDRESS` | local IP address in the case of First Hop Redundancy Protocols (FHRP) |
| `MAC_ADDRESS` | instead of MAC or MACADDR |
| `MEMBER_INTERFACE` | list of physical member interface names that are bundled to make an etherchannel, LACP, LAG, or port-channel interface |
| `MEMBER_INTERFACE_STATUS` | list of member interface statuses for an etherchannel, LACP, LAG, or port-channel interface |
| `MGMT_ADDRESS` | management address, used when data could be an Ethernet MAC address or an IP address (ex: CDP or LLDP templates) |
| `MGMT_IP_ADDRESS` | instead of MGMT_IP or MGMT_ADDRESS or MANAGEMENT_IP or REMOTE_MANAGEMENT_ADDRESS |
| `NEIGHBOR_DESCRIPTION` | often represents CDP or LLDP neighbor or system name description |
| `NEIGHBOR_ID` | for router IDs remote to the system being parsed |
| `NEIGHBOR_INTERFACE` | often represents neighbor or remote interface or port for CDP or LLDP |
| `NEIGHBOR_INTERFACE_DESCRIPTION` | represents CDP or LLDP neighbor (remote host) interface or port descriptions (Note: see NEIGHBOR_INTERFACE) |
| `NEIGHBOR_NAME` | often represents neighbor name for CDP or LLDP |
| `NETMASK` | for IPv4 dotted quad masks |
| `NETWORK` | for network numbers or subnet address (without the mask or prefix/slash notation); in place of ROUTE |
| `PLATFORM` | often represents CDP or LLDP neighbor's platform or model name/number |
| `PREFIX_LENGTH` | instead of PREFIX or CIDR for the numbers of a slash notation or CIDR mask |
| `PROTOCOL` | instead of PROTO |
| `ROUTER_ID` | for local router IDs (local to the device being parsed) |
| `VLAN_ID` | instead of VLAN or TAG |
| `VLAN_NAME` | VLAN name or description |
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Value NEIGHBOR (\S+)
Value NEIGHBOR_NAME (\S+)
Value LOCAL_INTERFACE (\S+)
Value NEIGHBOR_INTERFACE (\S+)

Start
^Port.*TTL -> LLDP

LLDP
^${LOCAL_INTERFACE}\s+${NEIGHBOR}\s+${NEIGHBOR_INTERFACE}\s+.* -> Record
^${LOCAL_INTERFACE}\s+${NEIGHBOR_NAME}\s+${NEIGHBOR_INTERFACE}\s+.* -> Record

Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
Value Required DEST_HOST (\S+)
Value SYSTEM_ID (.+?)
Value Required NEIGHBOR_NAME (\S+)
Value CHASSIS_ID (.+?)
Value MGMT_ADDRESS (.+?)
Value PLATFORM_VERSION (.+?)
Value REMOTE_PORT (.+?)
Value Filldown LOCAL_PORT (\S+?)
Value Filldown NEIGH_COUNT ([1-9]\d*)
Value NEIGHBOR_DESCRIPTION (.+?)
Value NEIGHBOR_INTERFACE (.+?)
Value Filldown LOCAL_INTERFACE (\S+?)
Value Filldown NEIGHBOR_COUNT ([1-9]\d*)
Value AGE (.+?)

Start
^\S+\s+${LOCAL_PORT}\s+\S+\s+${NEIGH_COUNT}.*
^\S+\s+${LOCAL_INTERFACE}\s+\S+\s+${NEIGHBOR_COUNT}.*
^.*age\s+${AGE}$$ -> Interface

Interface
^\s+Chassis ID\s+:\s+${SYSTEM_ID}$$
^\s+Chassis ID\s+:\s+${CHASSIS_ID}$$
^\s+-\s+Port ID type -> Port_ID
^\s+-\s+\S+\s+Name:\s+\"${DEST_HOST}\"
^.*System Description:\s+\"${PLATFORM_VERSION}(\"|$$)
^\s+-\s+\S+\s+Name:\s+\"${NEIGHBOR_NAME}\"
^.*System Description:\s+\"${NEIGHBOR_DESCRIPTION}(\"|$$)
^\s+\S+\s+Address\s+:\s+${MGMT_ADDRESS}$$
^\s*$$ -> Record Start

Port_ID
^\s+Port ID\s+:(\s+\"|\s+)${REMOTE_PORT}(\"|$$) -> Interface
^\s+Port ID\s+:(\s+\"|\s+)${NEIGHBOR_INTERFACE}(\"|$$) -> Interface
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
Value Required LOCAL_PORT (\S+)
Value Required LOCAL_INTERFACE (\S+)
Value Required CHASSIS_ID (\S+)
Value CHASSIS_NAME (\S+)
Value CHASSIS_DESC (.+)
Value NEIGHBOR_NAME (\S+)
Value NEIGHBOR_DESCRIPTION (.+)
Value CAPABILITIES_SUPPORTED (.+)
Value CAPABILITIES (.+)
Value CAPABILITIES_ENABLED (.+)
Value MGMT_ADDR (\S+)
Value PORT_ID (\S+)
Value PORT_DESC (\S+)
Value MGMT_ADDRESS (\S+)
Value NEIGHBOR_PORT_ID (\S+)
Value NEIGHBOR_INTERFACE (\S+)


Start
^Port\s*:\s*${LOCAL_PORT}
^Neighbor\s*Chassis-Name\s*:\s*${CHASSIS_NAME}
^Neighbor\s+System-Name\s*:\s*${CHASSIS_NAME}
^Neighbor\s*Chassis-Description\s*:\s*${CHASSIS_DESC}
^Neighbor\s+System-Description\s*:\s*${CHASSIS_DESC}
^Port\s*:\s*${LOCAL_INTERFACE}
^Neighbor\s*Chassis-Name\s*:\s*${NEIGHBOR_NAME}
^Neighbor\s+System-Name\s*:\s*${NEIGHBOR_NAME}
^Neighbor\s*Chassis-Description\s*:\s*${NEIGHBOR_DESCRIPTION}
^Neighbor\s+System-Description\s*:\s*${NEIGHBOR_DESCRIPTION}
^Neighbor\s*Chassis-ID\s*:\s*${CHASSIS_ID}
^Neighbor\s*Management-Address\s*:\s*${MGMT_ADDR}
^Chassis\s*Capabilities\s*Available\s*:\s*${CAPABILITIES}
^Chassis\s*Capabilities\s*Enabled\s*:\s*${CAPABILITIES_ENABLED}
^Neighbor\s*Port-ID\s*:\s*${PORT_ID}
^Neighbor\s*Port-Desc\s*:\s*${PORT_DESC}
^Neighbor\s*Management-Address\s*:\s*${MGMT_ADDRESS}
^Chassis\s*Capabilities\s*Available\s*:\s*${CAPABILITIES_SUPPORTED}
^Chassis\s*Capabilities\s*Enabled\s*:\s*${CAPABILITIES}
^Neighbor\s*Port-ID\s*:\s*${NEIGHBOR_PORT_ID}
^Neighbor\s*Port-Desc\s*:\s*${NEIGHBOR_INTERFACE}
^-+$$ -> Record
^Neighbor\.*
^TTL\.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Value ID (\S+)
Value INTERFACE (\S+)
Value NEIGHBOR_NAME (\S+)
Value LOCAL_INTERFACE (\S+)
Value HOLDTIME (\S+)
Value CAPABILITY ([\w]{1}(?:\s[\w]){0,2})
Value CAPABILITIES ([\w]{1}(?:\s[\w]){0,2})
Value PLATFORM ((\S+\s\S+)|(\S+))
Value PORT (.+)
Value NEIGHBOR_INTERFACE (.+)

Start
# Captures show isdp neighbors for:
Expand All @@ -13,6 +13,6 @@ Start
^\s+\S+\s+-
^\s*Device\s+ID\s+Intf\s+Holdtime\s+Capability\s+Platform\s+Port\s+ID$$
^-+
^\s*${ID}\s+${INTERFACE}\s+${HOLDTIME}\s+${CAPABILITY}\s+${PLATFORM}\s+${PORT} -> Record
^\s*${NEIGHBOR_NAME}\s+${LOCAL_INTERFACE}\s+${HOLDTIME}\s+${CAPABILITIES}\s+${PLATFORM}\s+${NEIGHBOR_INTERFACE} -> Record
^\s*$$
^. -> Error
^. -> Error
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Value LOCAL_INTERFACE (\S+)
Value REMOTE_ID (\S+)
Value CHASSIS_ID (\S+)
Value PORT_ID (\S+)
Value SYSTEM_NAME (\S+)
Value NEIGHBOR_INTERFACE (\S+)
Value NEIGHBOR_NAME (\S+)

Start
# Captures show lldp remote-device all for:
Expand All @@ -12,8 +12,8 @@ Start
^Local
^\s*Interface\s+RemID\s+Chassis\s+ID\s+Port\s+ID\s+System\s+Name$$
^-+
^\s*${LOCAL_INTERFACE}\s+${REMOTE_ID}\s+${CHASSIS_ID}\s+${PORT_ID}\s+${SYSTEM_NAME} -> Record
^\s*${LOCAL_INTERFACE}\s+${REMOTE_ID}\s+${CHASSIS_ID}\s+${NEIGHBOR_INTERFACE}\s+${NEIGHBOR_NAME} -> Record
# Match records that only include the interface value
^\s*${LOCAL_INTERFACE} -> Record
^\s*$$
^. -> Error
^. -> Error
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Value Required NEIGHBOR (\S+)
Value Required NEIGHBOR_NAME (\S+)
Value Required LOCAL_INTERFACE (\S+)
Value Required HOLD_TIME (\d+)
Value Required HOLDTIME (\d+)
Value Required CAPABILITIES (\S+)
Value Required NEIGHBOR_INTERFACE (\S+)

Start
^Capability.*
^\s+\(.*
^Device\s+ID\s+Local\s+Intf\s+Hold-time\s+Capability\s+Port\s+ID\s*$$
^${NEIGHBOR}\s+${LOCAL_INTERFACE}\s+${HOLD_TIME}\s+${CAPABILITIES}\s+${NEIGHBOR_INTERFACE} -> Record
^${NEIGHBOR_NAME}\s+${LOCAL_INTERFACE}\s+${HOLDTIME}\s+${CAPABILITIES}\s+${NEIGHBOR_INTERFACE} -> Record
^Total.*
^\s*$$
^. -> Error
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
Value Filldown interface ([0-9\/]+)
Value Required neimac (\w+\.\w+\.\w+)
Value ttlsecs (\d+)
Value neihostnametid (.+)
Value neiinterface ([a-zA-Z0-9\/\s]+)
Value neipvid (\d+|none)
Value neimgmtip (\d+\.\d+\.\d+\.\d+)
Value neilacpindex (\d+)
Value neimaxframesize (\d+)
Value neiopmau ([a-zA-Z0-9\-]+)
Value neicapabilities (.+)
Value Filldown LOCAL_INTERFACE ([0-9\/]+)
Value Required NEIGHBOR_PORT_ID (\w+\.\w+\.\w+)
Value HOLDTIME (\d+)
Value NEIGHBOR_NAME (.+)
Value NEIGHBOR_INTERFACE ([a-zA-Z0-9\/\s]+)
Value VLAN_ID (\d+|none)
Value MGMT_ADDRESS (\d+\.\d+\.\d+\.\d+)
Value NEIGHBOR_LACP_INDEX (\d+)
Value NEIGHBOR_MAX_FRAME_SIZE (\d+)
Value NEIGHBOR_MAU ([a-zA-Z0-9\-]+)
Value CAPABILITIES (.+)

Start
^\w -> Continue.Record
^Local\s+port:\s+${interface}
^\s+\+\s+System\s+name\s+:\s+"${neihostnametid}"
^\s+\+\s+Port\s+description\s+:\s+"${neiinterface}"
^\s+Enabled\s+capabilities\s*:\s+${neicapabilities}
^\s+\+\s+Port\s+VLAN\s+ID:\s+${neipvid}
^\s+\+\s+Management\s+address\s+\(IPv4\):\s+${neimgmtip}
^\s+\+\s+Link\s+aggregation:\s+aggregated\s+\(aggregated\s+port\s+ifIndex:\s+${neilacpindex}\)
^\s+\+\s+Maximum\s+frame\s+size:\s+${neimaxframesize}
^\s+Operational\s+MAU\s+type\s+:\s+${neiopmau}
^\s+Neighbor:\s+${neimac},\s+TTL\s+${ttlsecs}
^Local\s+port:\s+${LOCAL_INTERFACE}
^\s+\+\s+System\s+name\s+:\s+"${NEIGHBOR_NAME}"
^\s+\+\s+Port\s+description\s+:\s+"${NEIGHBOR_INTERFACE}"
^\s+Enabled\s+capabilities\s*:\s+${CAPABILITIES}
^\s+\+\s+Port\s+VLAN\s+ID:\s+${VLAN_ID}
^\s+\+\s+Management\s+address\s+\(IPv4\):\s+${MGMT_ADDRESS}
^\s+\+\s+Link\s+aggregation:\s+aggregated\s+\(aggregated\s+port\s+ifIndex:\s+${NEIGHBOR_LACP_INDEX}\)
^\s+\+\s+Maximum\s+frame\s+size:\s+${NEIGHBOR_MAX_FRAME_SIZE}
^\s+Operational\s+MAU\s+type\s+:\s+${NEIGHBOR_MAU}
^\s+Neighbor:\s+${NEIGHBOR_PORT_ID},\s+TTL\s+${HOLDTIME}
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
Value Filldown interface ([0-9\/]+)
Value Required neimac (\w+\.\w+\.\w+)
Value ttlsecs (\d+)
Value neihostnametid (.+)
Value neiinterface ([a-zA-Z0-9\/\s]+)
Value neipvid (\d+|none)
Value neimgmtip (\d+\.\d+\.\d+\.\d+)
Value neilacpindex (\d+)
Value neimaxframesize (\d+)
Value neiopmau ([a-zA-Z0-9\-]+)
Value neicapabilities (.+)
Value Filldown LOCAL_INTERFACE ([0-9\/]+)
Value Required NEIGHBOR_PORT_ID (\w+\.\w+\.\w+)
Value HOLDTIME (\d+)
Value NEIGHBOR_NAME (.+)
Value NEIGHBOR_INTERFACE ([a-zA-Z0-9\/\s]+)
Value VLAN_ID (\d+|none)
Value MGMT_ADDRESS (\d+\.\d+\.\d+\.\d+)
Value NEIGHBOR_LACP_INDEX (\d+)
Value NEIGHBOR_MAX_FRAME_SIZE (\d+)
Value NEIGHBOR_MAU ([a-zA-Z0-9\-]+)
Value CAPABILITIES (.+)

Start
^\w -> Continue.Record
^Local\s+port:\s+${interface}
^\s+\+\s+System\s+name\s+:\s+"${neihostnametid}"
^\s+\+\s+Port\s+description\s+:\s+"${neiinterface}"
^\s+Enabled\s+capabilities\s*:\s+${neicapabilities}
^\s+\+\s+Port\s+VLAN\s+ID:\s+${neipvid}
^\s+\+\s+Management\s+address\s+\(IPv4\):\s+${neimgmtip}
^\s+\+\s+Link\s+aggregation:\s+aggregated\s+\(aggregated\s+port\s+ifIndex:\s+${neilacpindex}\)
^\s+\+\s+Maximum\s+frame\s+size:\s+${neimaxframesize}
^\s+Operational\s+MAU\s+type\s+:\s+${neiopmau}
^\s+Neighbor:\s+${neimac},\s+TTL\s+${ttlsecs}
^Local\s+port:\s+${LOCAL_INTERFACE}
^\s+\+\s+System\s+name\s+:\s+"${NEIGHBOR_NAME}"
^\s+\+\s+Port\s+description\s+:\s+"${NEIGHBOR_INTERFACE}"
^\s+Enabled\s+capabilities\s*:\s+${CAPABILITIES}
^\s+\+\s+Port\s+VLAN\s+ID:\s+${VLAN_ID}
^\s+\+\s+Management\s+address\s+\(IPv4\):\s+${MGMT_ADDRESS}
^\s+\+\s+Link\s+aggregation:\s+aggregated\s+\(aggregated\s+port\s+ifIndex:\s+${NEIGHBOR_LACP_INDEX}\)
^\s+\+\s+Maximum\s+frame\s+size:\s+${NEIGHBOR_MAX_FRAME_SIZE}
^\s+Operational\s+MAU\s+type\s+:\s+${NEIGHBOR_MAU}
^\s+Neighbor:\s+${NEIGHBOR_PORT_ID},\s+TTL\s+${HOLDTIME}
10 changes: 5 additions & 5 deletions ntc_templates/templates/cisco_ios_show_cdp_neighbors.textfsm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Value Required NEIGHBOR (\S+)
Value Required NEIGHBOR_NAME (\S+)
Value LOCAL_INTERFACE (\S+(?:\s\S+)?)
Value CAPABILITY ((?:\w\s)*\w)
Value CAPABILITIES ((?:\w\s)*\w)
Value PLATFORM ((?:[IiPp]{2}\s)?\S+)
Value NEIGHBOR_INTERFACE (.+?)

Expand All @@ -11,6 +11,6 @@ Start
^Time\s+source\s+is

CDP
^${NEIGHBOR}$$
^\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
^${NEIGHBOR_NAME}$$
^\s*${LOCAL_INTERFACE}\s+\d+\s+${CAPABILITIES}\s+${PLATFORM}\s+${NEIGHBOR_INTERFACE}\s*$$ -> Record
^${NEIGHBOR_NAME}\s+${LOCAL_INTERFACE}\s+\d+\s+${CAPABILITIES}\s+${PLATFORM}\s+${NEIGHBOR_INTERFACE}\s*$$ -> Record
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
Value Required DESTINATION_HOST (\S+)
Value MANAGEMENT_IP (\d+\.\d+\.\d+\.\d+|\w+\.\w+\.\w+)
Value Required NEIGHBOR_NAME (\S+)
Value MGMT_ADDRESS (\d+\.\d+\.\d+\.\d+|\w+\.\w+\.\w+)
Value PLATFORM (.*)
Value REMOTE_PORT (.*)
Value LOCAL_PORT (.*)
Value SOFTWARE_VERSION (.*$)
Value NEIGHBOR_INTERFACE (.*)
Value LOCAL_INTERFACE (.*)
Value NEIGHBOR_DESCRIPTION (.*$)
Value CAPABILITIES (.+?)

Start
^Device ID: ${DESTINATION_HOST}
^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_PORT}, Port ID \(outgoing port\): ${REMOTE_PORT}
^Interface: ${LOCAL_INTERFACE}, Port ID \(outgoing port\): ${NEIGHBOR_INTERFACE}
^Version : -> GetVersion
# Capture time-stamp if vty line has command time-stamping turned on
^Load\s+for\s+
^Time\s+source\s+is

ParseIP
^.*IP address: ${MANAGEMENT_IP} -> Start
^.*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

GetVersion
^${SOFTWARE_VERSION} -> Record Start
^${NEIGHBOR_DESCRIPTION} -> Record Start
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Value Required NEIGHBOR (.{0,20}(?<! ))
Value Required NEIGHBOR_NAME (.{0,20}(?<! ))
Value Required LOCAL_INTERFACE (\S+)
Value CAPABILITIES (\S*)
Value Required NEIGHBOR_INTERFACE (\S+)
Expand All @@ -10,6 +10,6 @@ Start
^Time\s+source\s+is

LLDP
^${NEIGHBOR}\s*${LOCAL_INTERFACE}\s+\d+\s+${CAPABILITIES}\s+${NEIGHBOR_INTERFACE} -> Record
^${NEIGHBOR}
^${NEIGHBOR_NAME}\s*${LOCAL_INTERFACE}\s+\d+\s+${CAPABILITIES}\s+${NEIGHBOR_INTERFACE} -> Record
^${NEIGHBOR_NAME}
^\s+${LOCAL_INTERFACE}\s+\d+\s+${CAPABILITIES}\s+${NEIGHBOR_INTERFACE} -> Record
Loading
Loading