Skip to content

Commit

Permalink
Normalize CDP, LLDP, ISDP capture groups (#1469)
Browse files Browse the repository at this point in the history
* replace LOCAL_PORT with LOCAL_INTERFACE in CDP/LLDP templates to
normalize

* replace REMOTE_PORT with NEIGHBOR_INTERFACE in CDP/LLDP templates to
normalize

* add LOCAL_INTERFACE to data_model.md

* add NEIGHBOR_INTERFACE to data_model.md and reformat

* replace NEIGHBOR_PORT with NEIGHBOR_INTERFACE in
hp_procurve_show_cdp_neighbors_detail to normalize

* replace PORT_INFO with NEIGHBOR_INTERFACE for
juniper_junos_show_lldp_neighbors to normalize

* replace SYSTEM_CAPABILITIES_SUPPORTED with CAPABILITIES_SUPPORTED in
hp_procurve_show_lldp_info_remote-device_detail to normalize

* replace several capture groups for broadcom_icos_show_isdp_neighbors to
normalize with CDP/LLDP

* replace CAPABILITY with CAPABILITIES to normalize across CDP/LLDP

* replace SYSTEM_CAPABILITIES_ENABLED with CAPABILITIES for
hp_procurve_show_lldp_info_remote-device_detail to normalize

* replace NEIGHBOR_CAPABILITY with CAPABILITIES for
hp_procurve_show_cdp_neighbors_detail to normalize

* replace capabilities and neighbor interface capture groups for
aruba_aoscx_show_lldp_neighbors-info_detail to normalize

* correct swapped capture groups in hp_comware_display_lldp_neighbor-information_verbose
 - replace NEIGHBOR_INTERFACE with NEIGHBOR_INTERFACE_DESCRIPTION
 - replace NEIGHBOR_PORT_ID with NEIGHBOR_INTERFACE

* replace NEIGHBOR_INTERFACE_DESCR with NEIGHBOR_INTERFACE_DESCRIPTION in ipinfusion_ocnos_show_lldp_table to normalize

* replace PORT_DESCR with NEIGHBOR_INTERFACE_DESCRIPTION in
hp_procurve_show_lldp_info_remote-device_detail to normalize

* replace several capture groups in arista_eos_show_lldp_neighbors_detail
to normalize

* replace DEST_HOST and DESTINATION_HOST with CHASSIS_ID (and some instances of system name
with NEIGHBOR_NAME to normalize

* replace DEVICE_ID with CHASSIS_ID in cisco_s300_show_lldp_neighbors to
normalize

* replace NEIGHBOR_ID with CHASSIS_ID in
hp_procurve_show_cdp_neighbors_detail to normalize

* replace NEIGHBOR_CHASSIS_ID with CHASSIS_ID and PVID with VLAN_ID in
hp_procurve_show_lldp_info_remote-device_detail to normalize

* replace NEIGHBOR with NEIGHBOR_NAME in several CDP and LLDP templates to
normalize

* replace SYSTEM_NAME with NEIGHBOR_NAME to normalize

* replace NEIGHBOR_SYSNAME with NEIGHBOR_NAME in two hp_procurve LLDP
templates to normalize

* replace CHASSIS_NAME with NEIGHBOR_NAME in
aruba_aoscx_show_lldp_neighbors-info_detail to normalize

* normalize hp_procurve_show_lldp_info_remote-device with other CDP or
LLDP templates
 - replace NEIGHBOR_PORTID with NEIGHBOR_INTERFACE
 - replace NEIGHBOR_DESCR with NEIGHBOR_DESCRIPTION

* normalize hp_procurve_show_lldp_info_remote-device_detail with other CDP
or LLDP templates
 - replace NEIGHBOR_PORTID with NEIGHBOR_INTERFACE
 - replace SYSTEM_DESCR with NEIGHBOR_DESCRIPTION

* normalize aruba_aoscx_show_lldp_neighbors-info_detail with other CDP or
LLDP templates
 - replace CHASSIS_DESC with NEIGHBOR_DESCRIPTION
 - replace PORT_ID with NEIGHBOR_PORT_ID

* replace SYSTEM_DESCRIPTION with NEIGHBOR_DESCRIPTION to normalize cisco_ios_show_lldp_neighbors_detail

* replace SYSTEM_DESCRIPTION with NEIGHBOR_DESCRIPTION to normalize cisco_nxos_show_lldp_neighbors_detail

* replace SYSTEM_DESCRIPTION with NEIGHBOR_DESCRIPTION to normalize huawei_vrp_display_lldp_neighbor

* - normalize PLATFORM_VERSION with NEIGHBOR_DESCRIPTION in arista_eos_show_lldp_neighbors_detail
- normalize SOFTWARE_VERSION with NEIGHBOR_DESCRIPTION in cisco_ios_show_cdp_neighbors_detail

* - replace NEIGHBOR_VERSION with NEIGHBOR_DESCRIPTION in hp_procurve_show_cdp_neighbors_detail
- replace SOFTWARE_VERSION with NEIGHBOR_DESCRIPTION in cisco_wlc_ssh_show_cdp_neighbors_detail

* replace NEIGHBOR_CHASSIS_ID with CHASSIS_ID in
hp_procurve_show_lldp_info_remote-device to normalize

* - replace NEIGHBOR_PLATFORM with PLATFORM in hp_procurve_show_cdp_neighbors_detail
- replace MODEL with PLATFORM in cisco_ios_show_lldp_neighbors_detail
- replace MODEL_NAME with PLATFORM in huawei_vrp_display_lldp_neighbor

* replace MANUFACTURER_NAME with MANUFACTURER in
huawei_vrp_display_lldp_neighbor to normalize

* normalize management address capture groups in CDP/LLDP templates

- replace REMOTE_MANAGEMENT_ADDRESS with MGMT_ADDRESS in hp_procurve_show_lldp_info_remote-device_detail
- replace MGMT_ADDR with MGMT_ADDRESS in aruba_aoscx_show_lldp_neighbors-info_detail
- replace MGMT_IP with MGMT_ADDRESS in cisco_nxos and cisco_xr cdp template
- replace MANAGEMENT_IP with MGMT_ADDRESS in several templates

Note: Chose not to include "IP" in the capture group name because Arista data sometimes includes Ethernet MAC addresses

* replace NEIGHBOR_ADDRESS with MGMT_ADDRESS in hp_procurve_show_cdp_neighbors_detail

add mgmt_address to data_model.md

* replace PORT_ID with NEIGHBOR_INTERFACE in
broadcom_icos_show_lldp_remote-device_all to normalize

* normalize and capitalize capture groups in brocade_fastiron and
brocade_netiron show_lldp_neighbors_detail templates

* couple more fixes to normalize
- HOLD_TIME > HOLDTIME in brocade_fastiron_show_lldp_neighbors
- VERSION > NEIGHBOR_DESCRIPTION in cisco_nxos_show_cdp_neighbors_detail
- VERSION > NEIGHBOR_DESCRIPTION in cisco_xr_show_cdp_neighbors_detail

* fixing failed local merge in regard to huawei_vrp lldp
  • Loading branch information
mjbear authored Jun 21, 2024
1 parent 55c22b0 commit 86f5d01
Show file tree
Hide file tree
Showing 79 changed files with 1,720 additions and 1,663 deletions.
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
6 changes: 3 additions & 3 deletions ntc_templates/templates/cisco_ios_show_lldp_neighbors.textfsm
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

0 comments on commit 86f5d01

Please sign in to comment.