-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvoipPingTest.sh
executable file
·28 lines (28 loc) · 969 Bytes
/
voipPingTest.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
# Ping several servers and display Latency, Jitter and Packet Loss
#
# First, create a text file with all servers you want to ping - one host name per line.
# The list of voip.ms servers is available at http://wiki.voip.ms/article/Choosing_Server
myHF="voip-ms-hosts-to-test.txt"
# Sample file:
# toronto.voip.ms
# montreal.voip.ms
# seattle.voip.ms
# chicago.voip.ms
# newyork.voip.ms
#
echo "============================================"
printf "%-20s %7s %8s %6s\n" "VoIP Server" "Latency" "Jitter" "Loss"
echo "============================================"
cat ${myHF} |\
while read myLn
do
ping -c 3 -i 5 -q $myLn |\
awk '/^PING / {myH=$2}
/packet loss/ {myPL=$6}
/min\/avg\/max/ {
split($4,myS,"/")
printf( "%-20s %3.1f %1.3f %4s\n", myH, myS[2], myS[4], myPL)
}'
done
echo "============================================"