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

CiscoIOS 'show arp' template #1474

Merged
merged 3 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
16 changes: 16 additions & 0 deletions ntc_templates/templates/cisco_ios_show_arp.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Value PROTOCOL (\S+)
Value ADDRESS (\S+)
Value AGE_MIN (\S+)
Value HARDWARE_ADDR ((?:([a-f0-9]{4}\.){2}[a-f0-9]{4})|Incomplete)
jmcgill298 marked this conversation as resolved.
Show resolved Hide resolved
Value TYPE (\S+)
Value INTERFACE (\S+)

Start
^\s*Protocol\s+Address\s+Age\s+\(min\)\s+Hardware\s+Addr\s+Type\s+Interface\s*$$ -> ArpTable
^\s*$$
^. -> Error

ArpTable
^\s*${PROTOCOL}\s+${ADDRESS}\s+${AGE_MIN}\s+${HARDWARE_ADDR}\s+${TYPE}(?:\s+${INTERFACE})?\s*$$ -> Record
jmcgill298 marked this conversation as resolved.
Show resolved Hide resolved
^\s*$$
^. -> Error
1 change: 1 addition & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ cisco_ios_show_dmvpn.textfsm, .*, cisco_ios, sh[[ow]] dm[[vpn]]
cisco_ios_traceroute.textfsm, .*, cisco_ios, tr[[aceroute]]
cisco_ios_show_boot.textfsm, .*, cisco_ios, sh[[ow]] boot
cisco_ios_show_vlan.textfsm, .*, cisco_ios, sh[[ow]] vlan
cisco_ios_show_arp.textfsm, .*, cisco_ios, sh[[ow]] arp
cisco_ios_show_vrf.textfsm, .*, cisco_ios, sh[[ow]] vrf
cisco_ios_ping.textfsm, .*, cisco_ios, ping
cisco_ios_dir.textfsm, .*, cisco_ios, dir
Expand Down
6 changes: 6 additions & 0 deletions tests/cisco_ios/show_arp/cisco_ios_show_arp.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Protocol Address Age (min) Hardware Addr Type Interface
Internet 10.100.88.1 - c4f7.d564.b716 ARPA Vlan10
Internet 10.100.88.199 0 Incomplete ARPA
Internet 10.152.1.229 0 488f.5a5a.87ea ARPA Vlan1
Internet 1.2.3.4 0 c4ad.3425.b7be ARPA FastEthernet4
Internet 1.2.3.5 - c4f7.d564.b71a ARPA FastEthernet4
32 changes: 32 additions & 0 deletions tests/cisco_ios/show_arp/cisco_ios_show_arp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
parsed_sample:
- address: "10.100.88.1"
age_min: "-"
hardware_addr: "c4f7.d564.b716"
jmcgill298 marked this conversation as resolved.
Show resolved Hide resolved
interface: "Vlan10"
protocol: "Internet"
type: "ARPA"
- address: "10.100.88.199"
age_min: "0"
hardware_addr: "Incomplete"
jmcgill298 marked this conversation as resolved.
Show resolved Hide resolved
interface: ""
protocol: "Internet"
type: "ARPA"
- address: "10.152.1.229"
age_min: "0"
hardware_addr: "488f.5a5a.87ea"
jmcgill298 marked this conversation as resolved.
Show resolved Hide resolved
interface: "Vlan1"
protocol: "Internet"
type: "ARPA"
- address: "1.2.3.4"
age_min: "0"
hardware_addr: "c4ad.3425.b7be"
jmcgill298 marked this conversation as resolved.
Show resolved Hide resolved
interface: "FastEthernet4"
protocol: "Internet"
type: "ARPA"
- address: "1.2.3.5"
age_min: "-"
hardware_addr: "c4f7.d564.b71a"
jmcgill298 marked this conversation as resolved.
Show resolved Hide resolved
interface: "FastEthernet4"
protocol: "Internet"
type: "ARPA"
Loading