diff --git a/ntc_templates/templates/fortinet_execute_traceroute.textfsm b/ntc_templates/templates/fortinet_execute_traceroute.textfsm new file mode 100644 index 0000000000..3c99170bf9 --- /dev/null +++ b/ntc_templates/templates/fortinet_execute_traceroute.textfsm @@ -0,0 +1,14 @@ +Value DESTINATION_ADDRESS (\S+) +Value HOPS_MAX (\d+) +Value PACKETS_PER_HOP (\d+) +Value PACKET_SIZE (\d+) +Value HOP_NUM (\d+) +Value ADDRESS ((?!\*(?:\s+\*)*)\S+) +Value DETAILS (.*) + +Start + ^\s*traceroute\s+to\s+${DESTINATION_ADDRESS}\s+\(.*?\),\s+${HOPS_MAX}\s+hops\s+max,\s+${PACKETS_PER_HOP}\s+probe\s+packets\s+per\s+hop,\s+${PACKET_SIZE}\s+byte\s+packets\s*$$ + ^\s*${HOP_NUM}(?:\s+${ADDRESS})?\s+${DETAILS}\s*$$ -> Record + ^\s*\*\s*$$ + ^\s*$$ + ^. -> Error diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index 92f06d7570..5751458bdc 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -585,6 +585,7 @@ fortinet_execute_dhcp_lease-list.textfsm, .*, fortinet, exec[[ute]] dhcp lease-l fortinet_get_system_ha_status.textfsm, .*, fortinet, g[[et]] sy[[stem]] ha s[[tatus]] fortinet_get_system_interface.textfsm, .*, fortinet, g[[et]] sy[[stem]] in[[terface]] fortinet_execute_log_display.textfsm, .*, fortinet, exec[[ute]] l[[og]] di[[splay]] +fortinet_execute_traceroute.textfsm, .*, fortinet, exec[[ute]] traceroute fortinet_fnsysctl_ifconfig.textfsm, .*, fortinet, fnsysctl ifconfig fortinet_get_system_status.textfsm, .*, fortinet, g[[et]] sy[[stem]] stat[[us]] fortinet_diagnose_sys_top.textfsm, .*, fortinet, d[[iagnose]] sy[[s]] top diff --git a/tests/fortinet/execute_traceroute/fortinet_execute_traceroute1.raw b/tests/fortinet/execute_traceroute/fortinet_execute_traceroute1.raw new file mode 100644 index 0000000000..26e9edaa97 --- /dev/null +++ b/tests/fortinet/execute_traceroute/fortinet_execute_traceroute1.raw @@ -0,0 +1,3 @@ +traceroute to 8.8.8.8 (8.8.8.8), 32 hops max, 10 probe packets per hop, 84 byte packets + 1 1.2.3.4 0.454 ms 0.503 ms 0.262 ms 0.191 ms 0.187 ms 0.191 ms 0.191 ms 0.192 ms 0.193 ms 0.185 ms + 2 5.6.7.8 1.225 ms * * * diff --git a/tests/fortinet/execute_traceroute/fortinet_execute_traceroute1.yml b/tests/fortinet/execute_traceroute/fortinet_execute_traceroute1.yml new file mode 100644 index 0000000000..d3307ef79c --- /dev/null +++ b/tests/fortinet/execute_traceroute/fortinet_execute_traceroute1.yml @@ -0,0 +1,17 @@ +--- +parsed_sample: + - address: "1.2.3.4" + destination_address: "8.8.8.8" + details: "0.454 ms 0.503 ms 0.262 ms 0.191 ms 0.187 ms 0.191 ms 0.191 ms\ + \ 0.192 ms 0.193 ms 0.185 ms" + hop_num: "1" + hops_max: "32" + packet_size: "84" + packets_per_hop: "10" + - address: "5.6.7.8" + destination_address: "" + details: "1.225 ms * * *" + hop_num: "2" + hops_max: "" + packet_size: "" + packets_per_hop: "" diff --git a/tests/fortinet/execute_traceroute/fortinet_execute_traceroute2.raw b/tests/fortinet/execute_traceroute/fortinet_execute_traceroute2.raw new file mode 100644 index 0000000000..3324c50465 --- /dev/null +++ b/tests/fortinet/execute_traceroute/fortinet_execute_traceroute2.raw @@ -0,0 +1,7 @@ +traceroute to 8.8.8.8 (8.8.8.8), 32 hops max, 3 probe packets per hop, 84 byte packets + 1 1.2.3.4 0.423 ms 2.123 ms 0.274 ms + 2 5.6.7.8 0.389 ms 0.445 ms 0.178 ms + 3 * * * + 4 * * * + 5 * * * + 6 8.8.8.8 15.494 ms 15.488 ms 15.469 ms diff --git a/tests/fortinet/execute_traceroute/fortinet_execute_traceroute2.yml b/tests/fortinet/execute_traceroute/fortinet_execute_traceroute2.yml new file mode 100644 index 0000000000..5142ee4180 --- /dev/null +++ b/tests/fortinet/execute_traceroute/fortinet_execute_traceroute2.yml @@ -0,0 +1,44 @@ +--- +parsed_sample: + - address: "1.2.3.4" + destination_address: "8.8.8.8" + details: "0.423 ms 2.123 ms 0.274 ms" + hop_num: "1" + hops_max: "32" + packet_size: "84" + packets_per_hop: "3" + - address: "5.6.7.8" + destination_address: "" + details: "0.389 ms 0.445 ms 0.178 ms" + hop_num: "2" + hops_max: "" + packet_size: "" + packets_per_hop: "" + - address: "" + destination_address: "" + details: "* * *" + hop_num: "3" + hops_max: "" + packet_size: "" + packets_per_hop: "" + - address: "" + destination_address: "" + details: "* * *" + hop_num: "4" + hops_max: "" + packet_size: "" + packets_per_hop: "" + - address: "" + destination_address: "" + details: "* * *" + hop_num: "5" + hops_max: "" + packet_size: "" + packets_per_hop: "" + - address: "8.8.8.8" + destination_address: "" + details: "15.494 ms 15.488 ms 15.469 ms" + hop_num: "6" + hops_max: "" + packet_size: "" + packets_per_hop: ""