Skip to content

Simple Bash script to ping multiple targets and sort them by average latency. Good for choosing nearest datacenter by latency.

Notifications You must be signed in to change notification settings

zdeneksvarc/icmp-latency-check

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ICMP Latency Check

A simple Bash script that pings multiple targets and sorts them by average latency. Useful for choosing the nearest datacenter based on latency.

The IP addresses in the examples directory were taken from public sources (Shodan.io, RIPE NCC, web search).

Usage

Command Effect
./ping.sh 3 pings, use default.txt
./ping.sh 10 10 pings, use default.txt
./ping.sh examples/upcloud.txt 3 pings, use uplcoud.txt
./ping.sh 10 examples/hetzner.txt 10 pings, use hetzner.txt

Example

$ ./ping.sh
...
=================== SUMMARY ==================
Target               IP               Avg (ms)
----------------------------------------------
localhost            127.1            0.047
google.com           google.com       6.684
dns-opendns          208.67.222.222   7.810
dns-cloudflare       1.1              7.986
dns-quad9            9.9.9.9          11.116

$ ./ping.sh examples/upcloud.txt
...
=================== SUMMARY ==================
Target               IP               Avg (ms)
----------------------------------------------
Germany              94.237.103.106   14.237
Finland              85.9.218.236     25.783
Netherlands          85.9.211.180     26.241
UK                   94.237.54.200    37.810
Singapore            94.237.64.180    171.157

About

Simple Bash script to ping multiple targets and sort them by average latency. Good for choosing nearest datacenter by latency.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages