Skip to content

Instantly share code, notes, and snippets.

@coingraham
Forked from mlconnor/connectivity.sh
Created March 16, 2017 19:03
Show Gist options
  • Save coingraham/97c31c54bdbcb7023e315877f6f3ea94 to your computer and use it in GitHub Desktop.
Save coingraham/97c31c54bdbcb7023e315877f6f3ea94 to your computer and use it in GitHub Desktop.
Diagnose Connectivity
#set -o xtrace
echo "please copy the output of this script and send it to the network team so they can diagnose your issue"
DESTINATION=destination.foo.com
PORT=8089
echo "Dumping local network data"
ifconfig
# get the routing table
route -n
ping -c 5 $DESTINATION
echo "Running traceroute..."
traceroute -m 25 $DESTINATION
wget -q --tries=10 --timeout=20 --spider http://google.com
if [[ $? -eq 0 ]]; then
echo "OK - Internet Connectivity to google.com"
else
echo "FAILED - Internet Connectivity to google.com"
fi
echo "Checking connectivity to $DESTINATION on port $PORT"
nc -zv $DESTINATION $PORT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment