From f8acf707daa9edf5c107100cbafc533024f4bf40 Mon Sep 17 00:00:00 2001 From: jkraszewski Date: Wed, 14 Nov 2018 20:11:50 +0000 Subject: [PATCH 1/3] added juniper_junos_show_arp_no-resolve.template --- templates/index | 1 + templates/juniper_junos_show_arp_no-resolve.template | 10 ++++++++++ .../juniper_junos_show_arp_no-resolve.parsed | 1 + .../juniper_junos_show_arp_no-resolve.raw | 11 +++++++++++ 4 files changed, 23 insertions(+) create mode 100644 templates/juniper_junos_show_arp_no-resolve.template create mode 100644 tests/juniper_junos/show_arp_no-resolve/juniper_junos_show_arp_no-resolve.parsed create mode 100644 tests/juniper_junos/show_arp_no-resolve/juniper_junos_show_arp_no-resolve.raw diff --git a/templates/index b/templates/index index 7eb4fad59c..242c54ecd0 100644 --- a/templates/index +++ b/templates/index @@ -250,6 +250,7 @@ hp_procurve_show_system.template, .*, hp_procurve, sh[[ow]] syst[[em]] hp_procurve_show_vlans.template, .*, hp_procurve, sh[[ow]] vl[[ans]] hp_procurve_show_arp.template, .*, hp_procurve, sh[[ow]] ar[[p]] +juniper_junos_show_arp_no-resolve.template, .*, juniper_junos, sh[[ow]] a[[rp]] n[[o-resolve]] juniper_junos_show_chassis_firmware.template, .*, juniper_junos, sh[[ow]] ch[[assis]] fi[[rmware]] juniper_junos_show_isis_adjacency.template, .*, juniper_junos, sh[[ow]] is[[is]] ad[[jacency]] juniper_junos_show_ospf_neighbor.template, .*, juniper_junos, sh[[ow]] ospf n[[eighbor]] diff --git a/templates/juniper_junos_show_arp_no-resolve.template b/templates/juniper_junos_show_arp_no-resolve.template new file mode 100644 index 0000000000..ce085a2d8a --- /dev/null +++ b/templates/juniper_junos_show_arp_no-resolve.template @@ -0,0 +1,10 @@ +Value Required MAC ([A-Fa-f0-9\:]{17}) +Value Required IP_ADDRESS (\d+\.\d+\.\d+\.\d+) +Value Required INTERFACE (\S+) +Value Required FLAGS (\S+) + +Start + ^MAC Address\s+Address\s+Interface\s+Flags + ^${MAC}\s+${IP_ADDRESS}\s+${INTERFACE}\s+${FLAGS} -> Record + ^Total.* + ^. -> Error \ No newline at end of file diff --git a/tests/juniper_junos/show_arp_no-resolve/juniper_junos_show_arp_no-resolve.parsed b/tests/juniper_junos/show_arp_no-resolve/juniper_junos_show_arp_no-resolve.parsed new file mode 100644 index 0000000000..d7ffca8824 --- /dev/null +++ b/tests/juniper_junos/show_arp_no-resolve/juniper_junos_show_arp_no-resolve.parsed @@ -0,0 +1 @@ +[['00:00:00:00:00:04', '10.1.100.130', 'vlan.20', 'none'], ['00:00:00:00:00:05', '10.1.100.132', 'vlan.20', 'none'], ['00:00:00:00:00:08', '10.1.100.72', 'vlan.20', 'none'], ['00:00:00:00:00:09', '10.1.100.73', 'vlan.20', 'none'], ['00:00:00:00:00:0a', '10.1.100.74', 'vlan.20', 'none'], ['00:00:00:00:00:0b', '10.1.100.75', 'vlan.20', 'none'], ['00:00:00:00:00:0c', '10.1.100.76', 'vlan.20', 'none'], ['00:00:00:00:11:11', '10.1.111.11', 'vlan.20', 'none'], ['00:00:00:00:13:13', '10.1.13.13', 'vlan.20', 'none']] \ No newline at end of file diff --git a/tests/juniper_junos/show_arp_no-resolve/juniper_junos_show_arp_no-resolve.raw b/tests/juniper_junos/show_arp_no-resolve/juniper_junos_show_arp_no-resolve.raw new file mode 100644 index 0000000000..88e2916a83 --- /dev/null +++ b/tests/juniper_junos/show_arp_no-resolve/juniper_junos_show_arp_no-resolve.raw @@ -0,0 +1,11 @@ +MAC Address Address Interface Flags +00:00:00:00:00:04 10.1.100.130 vlan.20 none +00:00:00:00:00:05 10.1.100.132 vlan.20 none +00:00:00:00:00:08 10.1.100.72 vlan.20 none +00:00:00:00:00:09 10.1.100.73 vlan.20 none +00:00:00:00:00:0a 10.1.100.74 vlan.20 none +00:00:00:00:00:0b 10.1.100.75 vlan.20 none +00:00:00:00:00:0c 10.1.100.76 vlan.20 none +00:00:00:00:11:11 10.1.111.11 vlan.20 none +00:00:00:00:13:13 10.1.13.13 vlan.20 none +Total entries: 9 \ No newline at end of file From 1a65e8c2545c5af78d575accbba7baa020c5ff8a Mon Sep 17 00:00:00 2001 From: jkraszewski Date: Wed, 21 Nov 2018 21:18:51 +0000 Subject: [PATCH 2/3] reorder index and change parsed to yaml --- templates/index | 2 +- .../juniper_junos_show_arp_no-resolve.parsed | 39 ++++++++++++++++++- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/templates/index b/templates/index index 242c54ecd0..c4b206ca31 100644 --- a/templates/index +++ b/templates/index @@ -250,8 +250,8 @@ hp_procurve_show_system.template, .*, hp_procurve, sh[[ow]] syst[[em]] hp_procurve_show_vlans.template, .*, hp_procurve, sh[[ow]] vl[[ans]] hp_procurve_show_arp.template, .*, hp_procurve, sh[[ow]] ar[[p]] -juniper_junos_show_arp_no-resolve.template, .*, juniper_junos, sh[[ow]] a[[rp]] n[[o-resolve]] juniper_junos_show_chassis_firmware.template, .*, juniper_junos, sh[[ow]] ch[[assis]] fi[[rmware]] +juniper_junos_show_arp_no-resolve.template, .*, juniper_junos, sh[[ow]] a[[rp]] n[[o-resolve]] juniper_junos_show_isis_adjacency.template, .*, juniper_junos, sh[[ow]] is[[is]] ad[[jacency]] juniper_junos_show_ospf_neighbor.template, .*, juniper_junos, sh[[ow]] ospf n[[eighbor]] juniper_junos_show_interfaces.template, .*, juniper_junos, sh[[ow]] inte[[rfaces]] diff --git a/tests/juniper_junos/show_arp_no-resolve/juniper_junos_show_arp_no-resolve.parsed b/tests/juniper_junos/show_arp_no-resolve/juniper_junos_show_arp_no-resolve.parsed index d7ffca8824..dd151dbed3 100644 --- a/tests/juniper_junos/show_arp_no-resolve/juniper_junos_show_arp_no-resolve.parsed +++ b/tests/juniper_junos/show_arp_no-resolve/juniper_junos_show_arp_no-resolve.parsed @@ -1 +1,38 @@ -[['00:00:00:00:00:04', '10.1.100.130', 'vlan.20', 'none'], ['00:00:00:00:00:05', '10.1.100.132', 'vlan.20', 'none'], ['00:00:00:00:00:08', '10.1.100.72', 'vlan.20', 'none'], ['00:00:00:00:00:09', '10.1.100.73', 'vlan.20', 'none'], ['00:00:00:00:00:0a', '10.1.100.74', 'vlan.20', 'none'], ['00:00:00:00:00:0b', '10.1.100.75', 'vlan.20', 'none'], ['00:00:00:00:00:0c', '10.1.100.76', 'vlan.20', 'none'], ['00:00:00:00:11:11', '10.1.111.11', 'vlan.20', 'none'], ['00:00:00:00:13:13', '10.1.13.13', 'vlan.20', 'none']] \ No newline at end of file +--- +parsed_sample: +- mac: "00:00:00:00:00:04" + ip_address: "10.1.100.130" + interface: "vlan.20" + flags: "none" +- mac: "00:00:00:00:00:05" + ip_address: "10.1.100.132" + interface: "vlan.20" + flags: "none" +- mac: "00:00:00:00:00:08" + ip_address: "10.1.100.72" + interface: "vlan.20" + flags: "none" +- mac: "00:00:00:00:00:09" + ip_address: "10.1.100.73" + interface: "vlan.20" + flags: "none" +- mac: "00:00:00:00:00:0a" + ip_address: "10.1.100.74" + interface: "vlan.20" + flags: "none" +- mac: "00:00:00:00:00:0b" + ip_address: "10.1.100.75" + interface: "vlan.20" + flags: "none" +- mac: "00:00:00:00:00:0c" + ip_address: "10.1.100.76" + interface: "vlan.20" + flags: "none" +- mac: "00:00:00:00:11:11" + ip_address: "10.1.111.11" + interface: "vlan.20" + flags: "none" +- mac: "00:00:00:00:13:13" + ip_address: "10.1.13.13" + interface: "vlan.20" + flags: "none" From 1d0771a03c819cc36b28ccf6aead5c9b1cdda919 Mon Sep 17 00:00:00 2001 From: jkraszewski Date: Wed, 5 Dec 2018 18:31:53 +0000 Subject: [PATCH 3/3] improved juniper_junos_show_arp_no-resolve.template --- templates/juniper_junos_show_arp_no-resolve.template | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/templates/juniper_junos_show_arp_no-resolve.template b/templates/juniper_junos_show_arp_no-resolve.template index ce085a2d8a..d5ccfad7db 100644 --- a/templates/juniper_junos_show_arp_no-resolve.template +++ b/templates/juniper_junos_show_arp_no-resolve.template @@ -1,10 +1,11 @@ Value Required MAC ([A-Fa-f0-9\:]{17}) -Value Required IP_ADDRESS (\d+\.\d+\.\d+\.\d+) +Value Required IP_ADDRESS ([A-Fa-f0-9:\.]+) Value Required INTERFACE (\S+) -Value Required FLAGS (\S+) +Value FLAGS (\S+) Start - ^MAC Address\s+Address\s+Interface\s+Flags + ^MAC\s+Address\s+Address\s+Interface\s+Flags\s*$$ ^${MAC}\s+${IP_ADDRESS}\s+${INTERFACE}\s+${FLAGS} -> Record ^Total.* + ^\s*$$ ^. -> Error \ No newline at end of file