diff --git a/ntc_templates/templates/cisco_asa_ping.textfsm b/ntc_templates/templates/cisco_asa_ping.textfsm index 5830166e2f..bd443864bc 100644 --- a/ntc_templates/templates/cisco_asa_ping.textfsm +++ b/ntc_templates/templates/cisco_asa_ping.textfsm @@ -2,18 +2,19 @@ Value Required SENT_QTY (\d+) Value Required SENT_TYPE (.*) Value Required DESTINATION (\S+) Value Required TIMEOUT (\d+) -Value Required RESPONSE_STREAM ([\.\!]+) +Value Required RESPONSE_STREAM ([\.\!/Q/U]+) Value Required SUCCESS_PCT (\d+) Value Required SUCCESS_QTY (\d+) -Value Required RTT_MIN (\d+) -Value Required RTT_AVG (\d+) -Value Required RTT_MAX (\d+) +Value RTT_MIN (\d+) +Value RTT_AVG (\d+) +Value RTT_MAX (\d+) Start ^Type\s+escape\s+sequence\s+to\s+abort. ^Sending\s+${SENT_QTY},\s+${SENT_TYPE}\s+to\s+${DESTINATION},\s+timeout\s+is\s+${TIMEOUT}\s+seconds: ^${RESPONSE_STREAM} - ^Success\s+rate\s+is\s+${SUCCESS_PCT}\s+percent\s+\(${SUCCESS_QTY}/\d+\),\s+round-trip\s+min/avg/max\s+=\s+${RTT_MIN}/${RTT_AVG}/${RTT_MAX}\s+ms + ^Success\s+rate\s+is\s+${SUCCESS_PCT}\s+percent\s+\(${SUCCESS_QTY}\/\d+\)(?:,\s+round-trip\s+min/avg/max\s+\=\s+)?(?:${RTT_MIN}/${RTT_AVG}/${RTT_MAX})?(?:\sms)? ^\s*$$ - ^. -> Error + # Error out if raw data does not match any above rules. + ^.* -> Error "Could not parse line:" diff --git a/tests/cisco_asa/ping/cisco_asa_ping_mix.raw b/tests/cisco_asa/ping/cisco_asa_ping_mix.raw new file mode 100644 index 0000000000..f196e4e4e2 --- /dev/null +++ b/tests/cisco_asa/ping/cisco_asa_ping_mix.raw @@ -0,0 +1,4 @@ +Type escape sequence to abort. +Sending 5, 100-byte ICMP Echos to 10.245.179.14, timeout is 2 seconds: +Q..U! +Success rate is 20 percent (1/5), round-trip min/avg/max = 9/9/9 ms diff --git a/tests/cisco_asa/ping/cisco_asa_ping_mix.yml b/tests/cisco_asa/ping/cisco_asa_ping_mix.yml new file mode 100644 index 0000000000..58e4889378 --- /dev/null +++ b/tests/cisco_asa/ping/cisco_asa_ping_mix.yml @@ -0,0 +1,12 @@ +--- +parsed_sample: + - sent_qty: "5" + sent_type: "100-byte ICMP Echos" + destination: "10.245.179.14" + timeout: "2" + response_stream: "Q..U!" + success_pct: "20" + success_qty: "1" + rtt_min: "9" + rtt_avg: "9" + rtt_max: "9" diff --git a/tests/cisco_asa/ping/cisco_asa_ping_quench.raw b/tests/cisco_asa/ping/cisco_asa_ping_quench.raw new file mode 100644 index 0000000000..979125ea31 --- /dev/null +++ b/tests/cisco_asa/ping/cisco_asa_ping_quench.raw @@ -0,0 +1,4 @@ +Type escape sequence to abort. +Sending 5, 100-byte ICMP Echos to 10.245.179.14, timeout is 2 seconds: +Q..Q. +Success rate is 0 percent (0/5) diff --git a/tests/cisco_asa/ping/cisco_asa_ping_quench.yml b/tests/cisco_asa/ping/cisco_asa_ping_quench.yml new file mode 100644 index 0000000000..b2b64b9896 --- /dev/null +++ b/tests/cisco_asa/ping/cisco_asa_ping_quench.yml @@ -0,0 +1,12 @@ +--- +parsed_sample: + - sent_qty: "5" + sent_type: "100-byte ICMP Echos" + destination: "10.245.179.14" + timeout: "2" + response_stream: "Q..Q." + success_pct: "0" + success_qty: "0" + rtt_min: "" + rtt_avg: "" + rtt_max: "" diff --git a/tests/cisco_asa/ping/cisco_asa_ping_unreachable.raw b/tests/cisco_asa/ping/cisco_asa_ping_unreachable.raw new file mode 100644 index 0000000000..682eb4516c --- /dev/null +++ b/tests/cisco_asa/ping/cisco_asa_ping_unreachable.raw @@ -0,0 +1,4 @@ +Type escape sequence to abort. +Sending 5, 100-byte ICMP Echos to 10.245.179.14, timeout is 2 seconds: +U..U. +Success rate is 0 percent (0/5) diff --git a/tests/cisco_asa/ping/cisco_asa_ping_unreachable.yml b/tests/cisco_asa/ping/cisco_asa_ping_unreachable.yml new file mode 100644 index 0000000000..e3af5f0493 --- /dev/null +++ b/tests/cisco_asa/ping/cisco_asa_ping_unreachable.yml @@ -0,0 +1,12 @@ +--- +parsed_sample: + - sent_qty: "5" + sent_type: "100-byte ICMP Echos" + destination: "10.245.179.14" + timeout: "2" + response_stream: "U..U." + success_pct: "0" + success_qty: "0" + rtt_min: "" + rtt_avg: "" + rtt_max: ""