Skip to content

Commit

Permalink
Add MikroTik ip arp print template (#1491)
Browse files Browse the repository at this point in the history
Co-authored-by: pskliarenko <“[email protected]”>
  • Loading branch information
PavloSkliarenko and pskliarenko authored Jul 22, 2024
1 parent 1dc2c71 commit c488077
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
1 change: 1 addition & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,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"

0 comments on commit c488077

Please sign in to comment.