Commit d0d09624 authored by Kubernetes's avatar Kubernetes

Change the file naming pattern

parent 22c32bd6
#!/bin/bash
#
# name: pingmon
# version: 1.0.1
# version: 1.1.0
# description: Performs connectivity testing and saves detailed reports when something goes wrong
# author: Volodymyr Melnyk <v.melnyk@tucha.ua>
#
......@@ -73,7 +73,8 @@ function test_traceroute {
node_number=0
for node in "${nodes[@]}"; do
node_number=$((node_number+1))
{ ping -c 10 -i 0.1 ${node} > "${2}/ping-${node_number}-${node}.txt"; } &
node_number_formatted=$(printf "%03d" $node_nummber)
{ ping -c 10 ${node} > "${2}/ping-${node_number_formatted}-${node}.txt"; } &
done
wait
cat "${2}/ping-${node_number}-${nodes[$node_number-1]}.txt" | awk '/^[[:digit:]]+ packets transmitted, [[:digit:]]+ received, [[:digit:]]+(\.[[:digit:]]+)?% packet loss, time [[:digit:]]+ms$/ { percent = $6 + 0; if (percent > 0) { print percent } else { print "OK" } }'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment