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/ntc_templates/templates/cisco_ios_ping.textfsm b/ntc_templates/templates/cisco_ios_ping.textfsm index 815546879c..63b9e4a01a 100644 --- a/ntc_templates/templates/cisco_ios_ping.textfsm +++ b/ntc_templates/templates/cisco_ios_ping.textfsm @@ -3,7 +3,7 @@ Value Required SENT_TYPE (.*) Value Required DESTINATION (\S+) Value Required TIMEOUT (\d+) Value SOURCE (\S+) -Value List RESPONSE_STREAM ([\.\!]+) +Value List RESPONSE_STREAM ([\.\!/U/Q]+) Value Required SUCCESS_PCT (\d+) Value Required SUCCESS_QTY (\d+) Value RTT_MIN (\d+) diff --git a/ntc_templates/templates/cisco_xr_ping.textfsm b/ntc_templates/templates/cisco_xr_ping.textfsm new file mode 100644 index 0000000000..fbcae6e6e0 --- /dev/null +++ b/ntc_templates/templates/cisco_xr_ping.textfsm @@ -0,0 +1,24 @@ +Value Required SENT_QTY (\d+) +Value Required SENT_TYPE (.*) +Value Required DESTINATION (\S+) +Value Required TIMEOUT (\d+) +Value SOURCE (\S+) +Value List RESPONSE_STREAM ([\.\!/Q/U]+) +Value Required SUCCESS_PCT (\d+) +Value Required SUCCESS_QTY (\d+) +Value RTT_MIN (\d+) +Value RTT_AVG (\d+) +Value RTT_MAX (\d+) + + +Start + ^(Mon?)|(Tue?)|(Wed?)|(Thu?)|(Fri?)|(Sat?)|(Sun?)\s.*$$ + ^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: + ^Packet\s+sent\s+with\s+a\s+source\s+address\s+of\s+${SOURCE} + ^Packet\s+sent\s+with\s+the\s+DF\s+bit\s+set + ^${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})?(?:\sms)? + ^\s*$$ + # Error out if raw data does not match any above rules. + ^.* -> Error "Could not parse line:" diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index 391aa920b6..e794dec28a 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -474,6 +474,7 @@ cisco_xr_show_version.textfsm, .*, cisco_xr, sh[[ow]] ver[[sion]] cisco_xr_show_hsrp.textfsm, .*, cisco_xr, sh[[ow]] hs[[rp]] cisco_xr_show_arp.textfsm, .*, cisco_xr, sh[[ow]] arp cisco_xr_show_bgp.textfsm, .*, cisco_xr, sh[[ow]] bg[[p]] +cisco_xr_ping.textfsm, .*, cisco_xr, ping dell_force10_show_ip_interface_brief.textfsm, .*, dell_force10, sh[[ow]] ip int[[erface]] br[[ief]] dell_force10_show_vlan_brief.textfsm, .*, dell_force10, sh[[ow]] vl[[an]] br[[ief]] 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: "" diff --git a/tests/cisco_ios/ping/cisco_ios_ping_mix.raw b/tests/cisco_ios/ping/cisco_ios_ping_mix.raw new file mode 100644 index 0000000000..f196e4e4e2 --- /dev/null +++ b/tests/cisco_ios/ping/cisco_ios_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_ios/ping/cisco_ios_ping_mix.yml b/tests/cisco_ios/ping/cisco_ios_ping_mix.yml new file mode 100644 index 0000000000..17cb6885b1 --- /dev/null +++ b/tests/cisco_ios/ping/cisco_ios_ping_mix.yml @@ -0,0 +1,14 @@ +--- +parsed_sample: + - sent_qty: "5" + sent_type: "100-byte ICMP Echos" + destination: "10.245.179.14" + timeout: "2" + source: "" + response_stream: + - "Q..U!" + success_pct: "20" + success_qty: "1" + rtt_min: "9" + rtt_avg: "9" + rtt_max: "9" diff --git a/tests/cisco_ios/ping/cisco_ios_ping_quench.raw b/tests/cisco_ios/ping/cisco_ios_ping_quench.raw new file mode 100644 index 0000000000..979125ea31 --- /dev/null +++ b/tests/cisco_ios/ping/cisco_ios_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_ios/ping/cisco_ios_ping_quench.yml b/tests/cisco_ios/ping/cisco_ios_ping_quench.yml new file mode 100644 index 0000000000..ef631f8484 --- /dev/null +++ b/tests/cisco_ios/ping/cisco_ios_ping_quench.yml @@ -0,0 +1,14 @@ +--- +parsed_sample: + - sent_qty: "5" + sent_type: "100-byte ICMP Echos" + destination: "10.245.179.14" + timeout: "2" + source: "" + response_stream: + - "Q..Q." + success_pct: "0" + success_qty: "0" + rtt_min: "" + rtt_avg: "" + rtt_max: "" diff --git a/tests/cisco_ios/ping/cisco_ios_ping_unreachable.raw b/tests/cisco_ios/ping/cisco_ios_ping_unreachable.raw new file mode 100644 index 0000000000..682eb4516c --- /dev/null +++ b/tests/cisco_ios/ping/cisco_ios_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_ios/ping/cisco_ios_ping_unreachable.yml b/tests/cisco_ios/ping/cisco_ios_ping_unreachable.yml new file mode 100644 index 0000000000..74abcc87ae --- /dev/null +++ b/tests/cisco_ios/ping/cisco_ios_ping_unreachable.yml @@ -0,0 +1,14 @@ +--- +parsed_sample: + - sent_qty: "5" + sent_type: "100-byte ICMP Echos" + destination: "10.245.179.14" + timeout: "2" + source: "" + response_stream: + - "U..U." + success_pct: "0" + success_qty: "0" + rtt_min: "" + rtt_avg: "" + rtt_max: "" diff --git a/tests/cisco_xr/ping/cisco_xr_ping.raw b/tests/cisco_xr/ping/cisco_xr_ping.raw new file mode 100644 index 0000000000..95488ec5bc --- /dev/null +++ b/tests/cisco_xr/ping/cisco_xr_ping.raw @@ -0,0 +1,5 @@ +Fri Dec 22 17:30:39.512 BRA +Type escape sequence to abort. +Sending 5, 100-byte ICMP Echos to 10.191.129.114, timeout is 2 seconds: +!!!!! +Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms diff --git a/tests/cisco_xr/ping/cisco_xr_ping.yml b/tests/cisco_xr/ping/cisco_xr_ping.yml new file mode 100644 index 0000000000..681bf3107b --- /dev/null +++ b/tests/cisco_xr/ping/cisco_xr_ping.yml @@ -0,0 +1,14 @@ +--- +parsed_sample: + - sent_qty: "5" + sent_type: "100-byte ICMP Echos" + destination: "10.191.129.114" + timeout: "2" + source: "" + response_stream: + - "!!!!!" + success_pct: "100" + success_qty: "5" + rtt_min: "1" + rtt_avg: "1" + rtt_max: "1" diff --git a/tests/cisco_xr/ping/cisco_xr_ping_fail.raw b/tests/cisco_xr/ping/cisco_xr_ping_fail.raw new file mode 100644 index 0000000000..b219165ec0 --- /dev/null +++ b/tests/cisco_xr/ping/cisco_xr_ping_fail.raw @@ -0,0 +1,5 @@ +Fri Nov 17 16:29:18.710 BRA +Type escape sequence to abort. +Sending 5, 100-byte ICMP Echos to 10.27.18.2, timeout is 2 seconds: +..... +Success rate is 0 percent (0/5) diff --git a/tests/cisco_xr/ping/cisco_xr_ping_fail.yml b/tests/cisco_xr/ping/cisco_xr_ping_fail.yml new file mode 100644 index 0000000000..674e63ab03 --- /dev/null +++ b/tests/cisco_xr/ping/cisco_xr_ping_fail.yml @@ -0,0 +1,14 @@ +--- +parsed_sample: + - sent_qty: "5" + sent_type: "100-byte ICMP Echos" + destination: "10.27.18.2" + timeout: "2" + source: "" + response_stream: + - "....." + success_pct: "0" + success_qty: "0" + rtt_min: "" + rtt_avg: "" + rtt_max: "" diff --git a/tests/cisco_xr/ping/cisco_xr_ping_mix.raw b/tests/cisco_xr/ping/cisco_xr_ping_mix.raw new file mode 100644 index 0000000000..f196e4e4e2 --- /dev/null +++ b/tests/cisco_xr/ping/cisco_xr_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_xr/ping/cisco_xr_ping_mix.yml b/tests/cisco_xr/ping/cisco_xr_ping_mix.yml new file mode 100644 index 0000000000..17cb6885b1 --- /dev/null +++ b/tests/cisco_xr/ping/cisco_xr_ping_mix.yml @@ -0,0 +1,14 @@ +--- +parsed_sample: + - sent_qty: "5" + sent_type: "100-byte ICMP Echos" + destination: "10.245.179.14" + timeout: "2" + source: "" + response_stream: + - "Q..U!" + success_pct: "20" + success_qty: "1" + rtt_min: "9" + rtt_avg: "9" + rtt_max: "9" diff --git a/tests/cisco_xr/ping/cisco_xr_ping_quench.raw b/tests/cisco_xr/ping/cisco_xr_ping_quench.raw new file mode 100644 index 0000000000..d6fdea5d7e --- /dev/null +++ b/tests/cisco_xr/ping/cisco_xr_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: +QQQQQ +Success rate is 0 percent (0/5) diff --git a/tests/cisco_xr/ping/cisco_xr_ping_quench.yml b/tests/cisco_xr/ping/cisco_xr_ping_quench.yml new file mode 100644 index 0000000000..45c65e6b6f --- /dev/null +++ b/tests/cisco_xr/ping/cisco_xr_ping_quench.yml @@ -0,0 +1,14 @@ +--- +parsed_sample: + - sent_qty: "5" + sent_type: "100-byte ICMP Echos" + destination: "10.245.179.14" + timeout: "2" + source: "" + response_stream: + - "QQQQQ" + success_pct: "0" + success_qty: "0" + rtt_min: "" + rtt_avg: "" + rtt_max: "" diff --git a/tests/cisco_xr/ping/cisco_xr_ping_unreachable.raw b/tests/cisco_xr/ping/cisco_xr_ping_unreachable.raw new file mode 100644 index 0000000000..c4924217b2 --- /dev/null +++ b/tests/cisco_xr/ping/cisco_xr_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: +UUUUU +Success rate is 0 percent (0/5) diff --git a/tests/cisco_xr/ping/cisco_xr_ping_unreachable.yml b/tests/cisco_xr/ping/cisco_xr_ping_unreachable.yml new file mode 100644 index 0000000000..b6e47fa2ed --- /dev/null +++ b/tests/cisco_xr/ping/cisco_xr_ping_unreachable.yml @@ -0,0 +1,14 @@ +--- +parsed_sample: + - sent_qty: "5" + sent_type: "100-byte ICMP Echos" + destination: "10.245.179.14" + timeout: "2" + source: "" + response_stream: + - "UUUUU" + success_pct: "0" + success_qty: "0" + rtt_min: "" + rtt_avg: "" + rtt_max: ""