Skip to content

Commit

Permalink
Add Fortinet exec traceroute template (#1485)
Browse files Browse the repository at this point in the history
Co-authored-by: pskliarenko <“[email protected]”>
Co-authored-by: Jacob McGill <[email protected]>
  • Loading branch information
3 people authored Jul 22, 2024
1 parent 5b7d09f commit e16348e
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ntc_templates/templates/fortinet_execute_traceroute.textfsm
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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 * * *
17 changes: 17 additions & 0 deletions tests/fortinet/execute_traceroute/fortinet_execute_traceroute1.yml
Original file line number Diff line number Diff line change
@@ -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: ""
Original file line number Diff line number Diff line change
@@ -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
44 changes: 44 additions & 0 deletions tests/fortinet/execute_traceroute/fortinet_execute_traceroute2.yml
Original file line number Diff line number Diff line change
@@ -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: ""

0 comments on commit e16348e

Please sign in to comment.