Skip to content

Instantly share code, notes, and snippets.

@kelbyludwig
Created March 28, 2021 18:28
Show Gist options
  • Save kelbyludwig/7fc8a7e10ecb66242afda3fc785eac4a to your computer and use it in GitHub Desktop.
Save kelbyludwig/7fc8a7e10ecb66242afda3fc785eac4a to your computer and use it in GitHub Desktop.
This script prints ping rollup statistics against various Vultr hosts in specific locations.
#!/bin/sh
# This script runs $N pings against various Vultr hosts in specific locations.
N=5
ping_cleaned () {
ping -q -c $N $1 | grep 'ping statistics' --color=never -A 2 || break
echo ""
}
declare -a hosts=(
"tx-us-ping.vultr.com" # Dallas
"ga-us-ping.vultr.com" # Atlanta
"il-us-ping.vultr.com" # Chicago
"lax-ca-us-ping.vultr.com" # Los Angeles
"fl-us-ping.vultr.com" # Miami
"nj-us-ping.vultr.com" # New Jersey
"wa-us-ping.vultr.com" # Seattle
"sjo-ca-us-ping.vultr.com" # Silicon Valley
"tor-ca-ping.vultr.com" # Toronto
"ams-nl-ping.vultr.com" # Amerstdam
"fra-de-ping.vultr.com" # Frankfurt
"lon-gb-ping.vultr.com" # London
"par-fr-ping.vultr.com" # Paris
"sel-kor-ping.vultr.com" # Seoul
"sgp-ping.vultr.com" # Singapore
"hnd-jp-ping.vultr.com" # Tokyo
"syd-au-ping.vultr.com" # Sydney
)
for host in "${hosts[@]}"
do
ping_cleaned $host
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment