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

MikroTik RouterOS 'ip arp print' template #1491

Merged
Merged
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
1 change: 1 addition & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,7 @@ mikrotik_routeros_ip_route_print_terse.textfsm, .*, mikrotik_routeros, [[/]]ip(v
mikrotik_routeros_system_clock_print.textfsm, .*, mikrotik_routeros, [[/]]sy[[stem]] cl[[ock]] p[[rint]]
mikrotik_routeros_user_active_print.textfsm, .*, mikrotik_routeros, [[/]]us[[er]] ac[[tive]] p[[rint]]
mikrotik_routeros_ip_address_print.textfsm, .*, mikrotik_routeros, [[/]]ip ad[[dress]] p[[rint]]
mikrotik_routeros_ip_arp_print.textfsm, .*, mikrotik_routeros, [[/]]ip a[[rp]] p[[rint]]
mikrotik_routeros_ping.textfsm, .*, mikrotik_routeros, [[/]]pin[[g]]

oneaccess_oneos_show_voice_voip-call_active_all.textfsm, .*, oneaccess_oneos, sh[[ow]] voice voip-call active
Expand Down
17 changes: 17 additions & 0 deletions ntc_templates/templates/mikrotik_routeros_ip_arp_print.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Value NUM (\d+)
Value FLAGS ([XIHDPC]+)
Value IP_ADDRESS (\S+)
Value MAC_ADDRESS ((?:[0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2})
Value INTERFACE (\S+)

Start
^\s*Flags:\s+X\s+-\s+disabled,\s+I\s+-\s+invalid,\s+H\s+-\s+DHCP,\s+D\s+-\s+dynamic,\s+P\s+-\s+published,\s+C\s+-\s+complete\s*$$
^\s*#\s+ADDRESS\s+MAC-ADDRESS\s+INTERFACE\s*$$ -> EntriesTable
^\s*$$
^. -> Error

EntriesTable
^\s*${NUM}(?:\s+${FLAGS})?\s+${IP_ADDRESS}(?:\s+${MAC_ADDRESS})?(?:\s+${INTERFACE})?\s*$$ -> Record
^\s*(?:\d{2}:){2}\d{2}\s+echo:\s*.*$$
^\s*$$
^. -> Error
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Flags: X - disabled, I - invalid, H - DHCP, D - dynamic, P - published, C - complete
# ADDRESS MAC-ADDRESS INTERFACE
0 DC 10.160.1.230 12:34:56:78:90:AA ether2
1 10.152.1.230 12:34:56:78:90:AB ether5
2 10.152.1.231 12:34:56:78:90:AC
3 10.152.1.232 ether4
4 DC 10.152.1.233
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
parsed_sample:
- ip_address: "10.160.1.230"
flags: "DC"
interface: "ether2"
mac_address: "12:34:56:78:90:AA"
num: "0"
- ip_address: "10.152.1.230"
flags: ""
interface: "ether5"
mac_address: "12:34:56:78:90:AB"
num: "1"
- ip_address: "10.152.1.231"
flags: ""
interface: ""
mac_address: "12:34:56:78:90:AC"
num: "2"
- ip_address: "10.152.1.232"
flags: ""
interface: "ether4"
mac_address: ""
num: "3"
- ip_address: "10.152.1.233"
flags: "DC"
interface: ""
mac_address: ""
num: "4"
Loading