Skip to content

Instantly share code, notes, and snippets.

@ficus
Last active July 20, 2017 22:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ficus/4b7c5fa96cb7e231c2fdeb89fcda0911 to your computer and use it in GitHub Desktop.
Save ficus/4b7c5fa96cb7e231c2fdeb89fcda0911 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Simple script to test for network interruption blip we seem to experience for a moment btw. midnight and one. TNG 20170720
#
# * 0-1 * * * /home/tgodar/tmp_net_test/netcheck.sh | while IFS= read -r line; do echo "$(date) $line"; done >>/home/tgodar/tmp_net_test/netcheck.log
#
if ping -c1 -w10 google.acom | grep -q '1 packets transmitted\, 1 received\, \0\% packet loss'; then
echo "Ping OK."
else
echo "Ping Failed!"
echo "A--"
ss -s
echo "B---"
netstat -s
echo "C----"
ss -l
echo "D-----"
ss -t -a
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment