Last active
April 16, 2016 07:43
-
-
Save khmarochos/6566f80c4e369b699747deadb1d6b183 to your computer and use it in GitHub Desktop.
Ping the Host and Trace the Route
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TARGET=13.13.13.13; while :; do { PL=$(ping -c 10 -W 1 "${TARGET}" | sed -n -r 's/^.+ ([0-9]{1,3})% packet loss.+/\1/gp'); if [[ "${PL}" -gt 25 ]]; then { echo "$(date): ${PL}% of requests haven't got any responses"; mtr -i 0.1 -r -c 10 "${TARGET}"; echo; } fi; } done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment