Skip to content

Commit

Permalink
Standardize interface capture group (#1419)
Browse files Browse the repository at this point in the history
* Update index
* change interface capture group from INTF to INTERFACE to standardize
* change interface capture group from IFACE to INTERFACE to standardize
  • Loading branch information
mjbear authored Aug 3, 2023
1 parent af84007 commit 884a888
Show file tree
Hide file tree
Showing 70 changed files with 2,086 additions and 2,086 deletions.
4 changes: 2 additions & 2 deletions ntc_templates/templates/aruba_aoscx_show_bfd_all-vrfs.textfsm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Value Filldown ADMIN_STATUS (\w+)
Value Filldown SRC_IP (\S+)
Value SESSION (\d+)
Value IFACE (\S+)
Value INTERFACE (\S+)
Value VRF (\S+)
Value SOURCE_IP (\d+\.\d+\.\d+\.\d+)
Value DESTINATION_IP (\d+\.\d+\.\d+\.\d+)
Expand All @@ -17,7 +17,7 @@ Start
^Total.*$$
^Session\s+Interface\s+VRF\s+Source\s+IP\s+Destination\s+IP\s+Echo\s+State\s+Protocol
^\s*-+
^${SESSION}\s+${IFACE}\s+${VRF}\s+${SOURCE_IP}\s+${DESTINATION_IP}\s+${ECHO}\s+${STATE}\s+${APPLICATION} -> Record
^${SESSION}\s+${INTERFACE}\s+${VRF}\s+${SOURCE_IP}\s+${DESTINATION_IP}\s+${ECHO}\s+${STATE}\s+${APPLICATION} -> Record
^. -> Error

EOF
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Value IFACE (\S+)
Value INTERFACE (\S+)
Value IFACE_TYPE (\S+)
Value List CHANNEL (\d+)
Value TEMPERATURE (-?\d+\.\d+\w)
Expand Down Expand Up @@ -50,7 +50,7 @@ Value List TX_LOW_WARN_THRESHOLD (\d+\.\d+\w+)

Start
^Transceiver -> Continue.Record
^Transceiver\s+in\s+${IFACE}
^Transceiver\s+in\s+${INTERFACE}
^\s+Type:\s${IFACE_TYPE}
^\s+% No DOM information available -> Next.Clear
^\s+Temperature:\s+${TEMPERATURE} -> Common
Expand Down Expand Up @@ -110,5 +110,5 @@ Details
^\s+Tx Power low warning threshold: ${TX_LOW_WARN_THRESHOLD}
^\s*$$
^Transceiver -> Continue.Record
^Transceiver\s+in\s+${IFACE} -> Start
^Transceiver\s+in\s+${INTERFACE} -> Start
^\. -> Error
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Value Filldown IP (\d+\.\d+\.\d+\.\d+\/\d+)
Value Filldown VRF (\S+)
Value List IFACE (\S+)
Value List INTERFACE (\S+)
Value List METRIC (\[\S+\])
Value List STATUS (\w+)

Expand All @@ -10,5 +10,5 @@ Start
^\s*\S+\s+denotes.*
^\d+\.\d+\.\d+\.\d+\/\d+\W\s+vrf\s+\S+ -> Continue.Record
^${IP}\W\s+vrf\s+${VRF}
^\s+via\s+${IFACE},\s+${METRIC},\s+${STATUS}
^\s+via\s+${INTERFACE},\s+${METRIC},\s+${STATUS}
^. -> Error
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Value INTF (\S+\s\S+)
Value INTERFACE (\S+\s\S+)
Value IPADDR (\S+)
Value MASK (\S+)
Value ADMIN (\S+)
Value PROTOCOL (\S+)

Start
^${INTF}\s+${IPADDR}\s+/\s+${MASK}\s+${ADMIN}\s+${PROTOCOL} -> Record
^${INTERFACE}\s+${IPADDR}\s+/\s+${MASK}\s+${ADMIN}\s+${PROTOCOL} -> Record
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Value INTF (\S+\s\S+|\S+)
Value INTERFACE (\S+\s\S+|\S+)
Value List IPADDR (\S+)
Value ADMIN (\S+)
Value PROTOCOL (\S+)

Start
^${INTF}\s+\[\s+${ADMIN}/${PROTOCOL}\s+\] -> Interfaces
^${INTERFACE}\s+\[\s+${ADMIN}/${PROTOCOL}\s+\] -> Interfaces

Interfaces
^(\S+\s\S+|\S+)\s+\[\s+(\S+)/(\S+)\s+\] -> Continue.Record
^${INTF}\s+\[\s+${ADMIN}/${PROTOCOL}\s+\]
^${INTERFACE}\s+\[\s+${ADMIN}/${PROTOCOL}\s+\]
^\s+${IPADDR}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Value INTF (\S+)
Value INTERFACE (\S+)
Value IPADDR (\S+)
Value STATUS (up|down|administratively down)
Value PROTO (up|down)

Start
^Interface\s+IP-Address\s+OK\?\s+Method\s+Status\s+Protocol\s*$$
^${INTF}\s+${IPADDR}\s+\w+\s+\w+\s+${STATUS}\s+${PROTO} -> Record
^${INTERFACE}\s+${IPADDR}\s+\w+\s+\w+\s+${STATUS}\s+${PROTO} -> Record
^\s*$$
^. -> Error
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Value REMOTE_HEARD (\S+)
Value HOLDDOWN (\d+)
Value MULTIPLIER (\d{1,2})
Value STATE (\w+)
Value IFACE (\S+)
Value INTERFACE (\S+)
Value ECHO_FUNCTION ((?:\w+\s+)?\w+\s+echo\s+function)
Value ECHO_INTERVAL (\d+)
Value DIAGNOSTIC_BIT (\d)
Expand Down Expand Up @@ -39,9 +39,9 @@ Start
^. -> Error

BFD
^\s*${OUR_ADDR}\s*${NEIGHBOR_ADDR}\s+${LOCAL_DISCRIM}\/${REMOTE_DISCRIM}\s+${REMOTE_HEARD}\s+\d+\s+\(\s*\d+\s*\)\s+${STATE}\s+${IFACE}\s*$$
^\s*${OUR_ADDR}\s*${NEIGHBOR_ADDR}\s+${LOCAL_DISCRIM}\/${REMOTE_DISCRIM}\s+${REMOTE_HEARD}\s+\d+\s+\(\s*\d+\s*\)\s+${STATE}\s+${INTERFACE}\s*$$
#
^\s*${NEIGHBOR_ADDR}\s+${LOCAL_DISCRIM}\/${REMOTE_DISCRIM}\s+${REMOTE_HEARD}\s+${STATE}\s+${IFACE}\s*$$
^\s*${NEIGHBOR_ADDR}\s+${LOCAL_DISCRIM}\/${REMOTE_DISCRIM}\s+${REMOTE_HEARD}\s+${STATE}\s+${INTERFACE}\s*$$
^\s*OurAddr:\s+${OUR_ADDR}\s*$$
#
# common BFD details
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Value IFACE (\w+\d+\/\S+)
Value INTERFACE (\w+\d+\/\S+)
Value TEMPERATURE (\d+.\d+)
Value VOLTAGE (\d+.\d+)
Value TX_PWR (\S+)
Value RX_PWR (\S+)

Start
^${IFACE}\s+${TEMPERATURE}\s+${VOLTAGE}\s+${TX_PWR}\s+${RX_PWR}\s+ -> Record
^${INTERFACE}\s+${TEMPERATURE}\s+${VOLTAGE}\s+${TX_PWR}\s+${RX_PWR}\s+ -> Record
# Capture time-stamp if vty line has command time-stamping turned on
^Load\s+for\s+
^Time\s+source\s+is
4 changes: 2 additions & 2 deletions ntc_templates/templates/cisco_ios_show_ip_interface.textfsm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Value Required INTF (\S+)
Value Required INTERFACE (\S+)
Value LINK_STATUS (.+?)
Value PROTOCOL_STATUS (.+?)
Value List IPADDR (\S+?)
Expand All @@ -12,7 +12,7 @@ Value INBOUND_ACL (.*?)

Start
^\S -> Continue.Record
^${INTF}\s+is\s+${LINK_STATUS},\s+line\s+protocol\s+is\s+${PROTOCOL_STATUS}\s*$$
^${INTERFACE}\s+is\s+${LINK_STATUS},\s+line\s+protocol\s+is\s+${PROTOCOL_STATUS}\s*$$
^\s+Internet\s+address\s+is\s+${IPADDR}/?${MASK}\s*$$
^\s+Internet\s+address\s+will\s+be\s+negotiated
^\s+Secondary\s+address\s+${IPADDR}/?${MASK}\s*$$
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Value INTF (\S+)
Value INTERFACE (\S+)
Value IPADDR (\S+)
Value STATUS (up|down|administratively down)
Value PROTO (up|down)

Start
^${INTF}\s+${IPADDR}\s+\w+\s+\w+\s+${STATUS}\s+${PROTO} -> Record
^${INTERFACE}\s+${IPADDR}\s+\w+\s+\w+\s+${STATUS}\s+${PROTO} -> Record
# Capture time-stamp if vty line has command time-stamping turned on
^Load\s+for\s+
^Time\s+source\s+is
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Value INTF (\S+)
Value INTERFACE (\S+)
Value List IPADDR (\S+)
Value ADMIN (\S+|\S+\s\S+)
Value PROTOCOL (\S+|\S+\s\S+)


Start
^${INTF}\s+\[${ADMIN}/${PROTOCOL}\] -> Interfaces
^${INTERFACE}\s+\[${ADMIN}/${PROTOCOL}\] -> Interfaces
# Capture time-stamp if vty line has command time-stamping turned on
^Load\s+for\s+
^Time\s+source\s+is

Interfaces
^(\S+)\s+\[(\S+|\S+\s\S+)/(\S+|\S+\s\S+)\] -> Continue.Record
^${INTF}\s+\[${ADMIN}/${PROTOCOL}\]
^${INTERFACE}\s+\[${ADMIN}/${PROTOCOL}\]
^\s+${IPADDR}

6 changes: 3 additions & 3 deletions ntc_templates/templates/cisco_ios_show_standby_brief.textfsm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Value IFACE (\S+)
Value INTERFACE (\S+)
Value GROUP (\d+)
Value PRIORITY (\d+)
Value PREEMPT (.)
Expand All @@ -14,8 +14,8 @@ Start
^Time\s+source\s+is

Standby
^${IFACE}\s+${GROUP}\s+${PRIORITY}\s+${PREEMPT}\s+${STATE}\s+${ACTIVE}\s+${STANDBY}\s+${VIRTUALIP} -> Record
^${IFACE}\s*$$
^${INTERFACE}\s+${GROUP}\s+${PRIORITY}\s+${PREEMPT}\s+${STATE}\s+${ACTIVE}\s+${STANDBY}\s+${VIRTUALIP} -> Record
^${INTERFACE}\s*$$
^\s*${GROUP}\s+${PRIORITY}\s+${PREEMPT}\s+${STATE}\s+${ACTIVE}\s+${STANDBY}\s+${VIRTUALIP} -> Record
^\s*$$
^. -> Error
4 changes: 2 additions & 2 deletions ntc_templates/templates/cisco_ios_show_vrrp_all.textfsm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Value IFACE (\S+)
Value INTERFACE (\S+)
Value GROUP (\d+)
Value ADDR_FAMILY (\S+)
Value STATE (\w+)
Expand All @@ -19,7 +19,7 @@ Value MASTER_DOWN_INTERVAL (\S+)

Start
^\S+\s+-\s+Group\s+\d+.*$$ -> Continue.Record
^\s*${IFACE}\s+-\s+Group\s+${GROUP}(\s+-\s+Address-Family\s+${ADDR_FAMILY})?\s*$$
^\s*${INTERFACE}\s+-\s+Group\s+${GROUP}(\s+-\s+Address-Family\s+${ADDR_FAMILY})?\s*$$
^\s+State is\s+${STATE}.*\s*$$
^\s*State duration\s+${STATE_DURATION}\s*$$
^\s+Virtual IP address is\s+${VIRTUALIP}\s*$$
Expand Down
14 changes: 7 additions & 7 deletions ntc_templates/templates/cisco_ios_show_vrrp_brief.textfsm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Value IFACE (\S+)
Value INTERFACE (\S+)
Value GROUP (\d+)
Value ADDR_FAMILY (\S+)
Value PRIORITY (\d+)
Expand All @@ -18,21 +18,21 @@ Start

Vrrp
# VRRP Legacy (VRRPv2 for IPv4)
^${IFACE}\s+${GROUP}\s*${PRIORITY}\s+${TIME}\s+${OWN}\s+${PREEMPT}\s+${STATE}\s+${MASTER_IP}\s+${VIRTUALIP} -> Record
^${IFACE}\s*$$
^${INTERFACE}\s+${GROUP}\s*${PRIORITY}\s+${TIME}\s+${OWN}\s+${PREEMPT}\s+${STATE}\s+${MASTER_IP}\s+${VIRTUALIP} -> Record
^${INTERFACE}\s*$$
^\s*${GROUP}\s+${PRIORITY}\s+${TIME}\s+${OWN}\s+${PREEMPT}\s+${STATE}\s+${MASTER_IP}\s+${VIRTUALIP} -> Record
^\s*$$
^. -> Error

Vrrpv3
# VRRP Unified (VRRPv3 for IPv4 and IPv6)
# - ignoring the "local" designation since we can use the STATE value to determine who the master is
^\s*${IFACE}\s+${GROUP}\s+${ADDR_FAMILY}\s+${PRIORITY}\s+${TIME}\s+${OWN}\s+${PREEMPT}\s+${STATE}\s+${MASTER_IP}\(local\)\s+${VIRTUALIP} -> Record
^\s*${IFACE}\s+${GROUP}\s+${ADDR_FAMILY}\s+${PRIORITY}\s+${TIME}\s+${OWN}\s+${PREEMPT}\s+${STATE}\s+${MASTER_IP}\s+${VIRTUALIP} -> Record
^\s*${INTERFACE}\s+${GROUP}\s+${ADDR_FAMILY}\s+${PRIORITY}\s+${TIME}\s+${OWN}\s+${PREEMPT}\s+${STATE}\s+${MASTER_IP}\(local\)\s+${VIRTUALIP} -> Record
^\s*${INTERFACE}\s+${GROUP}\s+${ADDR_FAMILY}\s+${PRIORITY}\s+${TIME}\s+${OWN}\s+${PREEMPT}\s+${STATE}\s+${MASTER_IP}\s+${VIRTUALIP} -> Record
# rows that roll over to a second line
^\s*${IFACE}\s*$$
^\s*${INTERFACE}\s*$$
^\s*${GROUP}\s+${ADDR_FAMILY}\s+${PRIORITY}\s+${TIME}\s+${OWN}\s+${PREEMPT}\s+${STATE}\s+${MASTER_IP}\(local\)\s+${VIRTUALIP} -> Record
^\s*${IFACE}\s*$$
^\s*${INTERFACE}\s*$$
^\s*${GROUP}\s+${ADDR_FAMILY}\s+${PRIORITY}\s+${TIME}\s+${OWN}\s+${PREEMPT}\s+${STATE}\s+${MASTER_IP}\s+${VIRTUALIP} -> Record
^\s*$$
^. -> Error
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Value Filldown VRF (\S+)
Value Required INTF (\S+)
Value Required INTERFACE (\S+)
Value Required IPADDR ([a-zA-Z0-9./]+)
Value STATUS (\S+-\S+)
Value LINK (\S+-\S+)
Expand All @@ -8,6 +8,6 @@ Value PROTO (\S+-\S+)
Start
^IP\s+Interface\s+Status\s+for\s+VRF\s+"${VRF}"\(\d+\)
^Interface\s+IP\s+Address\s+Interface\s+Status
^${INTF}\s+${IPADDR}\s+${PROTO}/${LINK}/${STATUS} -> Record
^${INTERFACE}\s+${IPADDR}\s+${PROTO}/${LINK}/${STATUS} -> Record
^\s*$$
^.*$$ -> Error
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Value VRF (\S+)
Value INTF (\S+)
Value INTERFACE (\S+)
Value IPADDR ([a-zA-Z0-9./]+)
Value STATUS (\S+-\S+)
Value LINK (\S+-\S+)
Expand All @@ -26,7 +26,7 @@ Value WCCP_REDIRECT_EXCLUDE (\S+)

Start
^IP\s+Interface\s+Status\s+for\s+VRF\s+"${VRF}"
^${INTF},\s+Interface\s+status:\s+${PROTO}/${LINK}/${STATUS}
^${INTERFACE},\s+Interface\s+status:\s+${PROTO}/${LINK}/${STATUS}
^\s+IP\s+address:\s+${IPADDR},\s+IP\s+subnet:\s+${SUBNET}\s+route-preference:\s+${ROUTE_PREF},\s+tag:\s+${ROUTE_TAG}
^\s+IP\s+broadcast\s+address:\s+${BROADCAST}
^\s+IP\s+multicast\s+groups\s+locally\s+joined:\s+${MULTICAST_GROUPS}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Value Required INTF (\S+)
Value Required INTERFACE (\S+)
Value Required IPADDR ([a-zA-Z0-9:/]+)
Value LINKIPADDR ([a-zA-Z0-9:/]+)
Value STATUS (\S+/\S+)
Value PROTO (\S+)

Start
^${INTF}\s+${IPADDR}\s+${STATUS}/${PROTO}
^${INTERFACE}\s+${IPADDR}\s+${STATUS}/${PROTO}
^\s+${LINKIPADDR} -> Record

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Value INTF (.+?)
Value INTERFACE (.+?)
Value IPADDR (\S+)
Value STATUS (Up|Down|Shutdown)
Value PROTO (Up|Down)
Value VRF (\S+)

Start
^${INTF}\s+${IPADDR}\s+${STATUS}\s+${PROTO}\s+${VRF} -> Record
^${INTERFACE}\s+${IPADDR}\s+${STATUS}\s+${PROTO}\s+${VRF} -> Record
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Value Required INTF ([\w\./-]+)
Value Required INTERFACE ([\w\./-]+)
Value IPADDR (\d+\.\d+\.\d+\.\d+)
Value STATUS (\w+)
Value PROTO (\w+)
Value VRF (\S+)

Start
^\s*Interface\s+IP-Address\s+Status\s+Protocol(\s+Vrf-Name)?\s*$$
^\s*${INTF}\s+${IPADDR}\s+${STATUS}\s+${PROTO}(\s+${VRF})?\s*$$ -> Record
^\s*${INTERFACE}\s+${IPADDR}\s+${STATUS}\s+${PROTO}(\s+${VRF})?\s*$$ -> Record
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Value INTF (\S+ \S+)
Value INTERFACE (\S+ \S+)
Value IPADDR (\S+)
Value OK (YES|NO)
Value METHOD (None|Manual)
Value STATUS (up|down)
Value PROTO (up|down)

Start
^${INTF}\s+${IPADDR}\s+${OK}\s+${METHOD}\s+${STATUS}\s+${PROTO} -> Record
^${INTERFACE}\s+${IPADDR}\s+${OK}\s+${METHOD}\s+${STATUS}\s+${PROTO} -> Record
6 changes: 3 additions & 3 deletions ntc_templates/templates/hp_comware_display_interface.textfsm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Value Required INTF (\S+)
Value Required INTERFACE (\S+)
Value LINE_STATUS (UP|DOWN|Administratively DOWN)
Value PROTOCOL_STATUS (UP(\(spoofing\))?|DOWN)
Value List IP_ADDRESS (\S+)
Expand All @@ -16,9 +16,9 @@ Value List VLAN_PERMITTED ([^,]+)

Start
#^\S+$$.Record
^\s*${INTF}$$
^\s*${INTERFACE}$$
^\s*Current\s+state:\s+${LINE_STATUS}
^\s*${INTF}\s+current\s+state\s*:\s*${LINE_STATUS}
^\s*${INTERFACE}\s+current\s+state\s*:\s*${LINE_STATUS}
^\s*Line\s+protocol\s+state:\s+${PROTOCOL_STATUS}
^\s*Line\s+protocol\s+current\s+state:\s+${PROTOCOL_STATUS}
^\s*Description:\s+${DESCRIPTION}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Value INTF (\S+)
Value INTERFACE (\S+)
Value LINE_STATUS (UP|DOWN|Administratively DOWN)
Value PROTOCOL_STATUS (UP(\(spoofing\))?|DOWN)
Value ROUTE_MAP (\S+)
Expand All @@ -7,13 +7,13 @@ Value MTU (\d+)


Start
^${INTF}\s+current\s+state\s*:\s*${LINE_STATUS} -> Interface
^${INTERFACE}\s+current\s+state\s*:\s*${LINE_STATUS} -> Interface
^. -> Error


Interface
^\S+\s+current\s+state -> Continue.Record
^${INTF}\s+current\s+state\s*:\s*${LINE_STATUS}
^${INTERFACE}\s+current\s+state\s*:\s*${LINE_STATUS}
^Line\s+protocol\s+current\s+state\s*:\s*${PROTOCOL_STATUS}
^Internet\s+Address\s+is\s+${IPADDR}\s+Primary
^Internet\s+Address\s+is\s+${IPADDR}\s+Sub
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Value INTF (\S+)
Value INTERFACE (\S+)
Value ID (\S+)
Value SPEED (\[n/a\]|\S+)
Value DUPLEX (\[n/a\]|\S+)
Value STATE (\S+)
Value ADDRESS ([a-fA-F0-9]{2}\:[a-fA-F0-9]{2}\:[a-fA-F0-9]{2}\:[a-fA-F0-9]{2}\:[a-fA-F0-9]{2}\:[a-fA-F0-9]{2})

Start
^${INTF}\s+${ID}\s+${SPEED}/${DUPLEX}/${STATE}\s+${ADDRESS} -> Record
^${INTERFACE}\s+${ID}\s+${SPEED}/${DUPLEX}/${STATE}\s+${ADDRESS} -> Record
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Value INTF (\S+)
Value INTERFACE (\S+)
Value ID (\d+)
Value VSYS (\d+)
Value ZONE (\S+)
Expand All @@ -7,5 +7,5 @@ Value VLAN_ID (\d+)
Value ADDRESS (\S+)

Start
^${INTF}\s+${ID}\s+${VSYS}\s+${ZONE}\s+${FORWARDING}+\s+${VLAN_ID}\s+${ADDRESS} -> Record
^${INTF}\s+${ID}\s+${VSYS}\s+${FORWARDING}\s+${VLAN_ID}\s+${ADDRESS} -> Record
^${INTERFACE}\s+${ID}\s+${VSYS}\s+${ZONE}\s+${FORWARDING}+\s+${VLAN_ID}\s+${ADDRESS} -> Record
^${INTERFACE}\s+${ID}\s+${VSYS}\s+${FORWARDING}\s+${VLAN_ID}\s+${ADDRESS} -> Record
Loading

0 comments on commit 884a888

Please sign in to comment.