From 70ee76bda59b75365e7a2e9a659f253064d2010a Mon Sep 17 00:00:00 2001 From: Arthur <153854614+ArthurGUYON@users.noreply.github.com> Date: Thu, 17 Oct 2024 17:55:55 +0200 Subject: [PATCH] fix: Mikrotik ip arp print without-paging (#1882) --- ...ik_routeros_ip_arp_print_without-paging.textfsm | 5 +++-- ...krotik_routeros_ip_arp_print_without-paging.yml | 2 ++ ...rotik_routeros_ip_arp_print_without-paging2.raw | 6 ++++++ ...rotik_routeros_ip_arp_print_without-paging2.yml | 14 ++++++++++++++ 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 tests/mikrotik_routeros/ip_arp_print_without-paging/mikrotik_routeros_ip_arp_print_without-paging2.raw create mode 100644 tests/mikrotik_routeros/ip_arp_print_without-paging/mikrotik_routeros_ip_arp_print_without-paging2.yml diff --git a/ntc_templates/templates/mikrotik_routeros_ip_arp_print_without-paging.textfsm b/ntc_templates/templates/mikrotik_routeros_ip_arp_print_without-paging.textfsm index 9b70f8eaa8..caa23e51c0 100644 --- a/ntc_templates/templates/mikrotik_routeros_ip_arp_print_without-paging.textfsm +++ b/ntc_templates/templates/mikrotik_routeros_ip_arp_print_without-paging.textfsm @@ -3,11 +3,12 @@ Value FLAGS ([XIHDPC]+) Value IP_ADDRESS (\S+) Value MAC_ADDRESS (([0-9a-fA-F]{2}[:]){5}([0-9a-fA-F]{2})) Value INTERFACE (\S+) +Value STATUS (\S+) Start - ^\s*#\s*ADDRESS\s*MAC-ADDRESS\s*INTERFACE\s*$$ -> EntriesTable + ^\s*#\s*ADDRESS\s*MAC-ADDRESS\s*INTERFACE\s*(STATUS)?\s*$$ -> EntriesTable EntriesTable - ^\s*${INDEX}\s*(${FLAGS})?\s*${IP_ADDRESS}\s*(${MAC_ADDRESS})?\s+(${INTERFACE})?\s*$$ -> Record + ^\s*${INDEX}\s*(${FLAGS})?\s*${IP_ADDRESS}\s*(${MAC_ADDRESS})?\s+(${INTERFACE})?\s*(${STATUS})?\s*$$ -> Record ^\s*(?:\d{2}:){2}\d{2}\s+echo:\s*.*$$ -> Next ^. -> Error diff --git a/tests/mikrotik_routeros/ip_arp_print_without-paging/mikrotik_routeros_ip_arp_print_without-paging.yml b/tests/mikrotik_routeros/ip_arp_print_without-paging/mikrotik_routeros_ip_arp_print_without-paging.yml index d11aabc07c..ed57d1e20a 100644 --- a/tests/mikrotik_routeros/ip_arp_print_without-paging/mikrotik_routeros_ip_arp_print_without-paging.yml +++ b/tests/mikrotik_routeros/ip_arp_print_without-paging/mikrotik_routeros_ip_arp_print_without-paging.yml @@ -5,8 +5,10 @@ parsed_sample: interface: "dmz-1-vlan" ip_address: "185.163.212.158" mac_address: "" + status: "" - flags: "" index: "1" interface: "vlan-2" ip_address: "185.163.212.159" mac_address: "AF:D6:C8:F2:36:16" + status: "" diff --git a/tests/mikrotik_routeros/ip_arp_print_without-paging/mikrotik_routeros_ip_arp_print_without-paging2.raw b/tests/mikrotik_routeros/ip_arp_print_without-paging/mikrotik_routeros_ip_arp_print_without-paging2.raw new file mode 100644 index 0000000000..cb22e7c5ca --- /dev/null +++ b/tests/mikrotik_routeros/ip_arp_print_without-paging/mikrotik_routeros_ip_arp_print_without-paging2.raw @@ -0,0 +1,6 @@ +Flags: D - DYNAMIC; C - COMPLETE +Columns: ADDRESS, MAC-ADDRESS, INTERFACE, STATUS +# ADDRESS MAC-ADDRESS INTERFACE STATUS +0 DC 192.168.1.10 50:50:40:40:2E:C1 bridge-lan stale +17:20:06 echo: system,error,critical login failure for user admin from 80.100.100.11 via ssh +1 D 192.168.1.11 C7:50:40:40:2A:C1 bridge-lan reachable diff --git a/tests/mikrotik_routeros/ip_arp_print_without-paging/mikrotik_routeros_ip_arp_print_without-paging2.yml b/tests/mikrotik_routeros/ip_arp_print_without-paging/mikrotik_routeros_ip_arp_print_without-paging2.yml new file mode 100644 index 0000000000..6ffe007a61 --- /dev/null +++ b/tests/mikrotik_routeros/ip_arp_print_without-paging/mikrotik_routeros_ip_arp_print_without-paging2.yml @@ -0,0 +1,14 @@ +--- +parsed_sample: + - flags: "DC" + index: "0" + ip_address: "192.168.1.10" + mac_address: "50:50:40:40:2E:C1" + interface: "bridge-lan" + status: "stale" + - flags: "D" + index: "1" + ip_address: "192.168.1.11" + mac_address: "C7:50:40:40:2A:C1" + interface: "bridge-lan" + status: "reachable"