Last active
February 16, 2019 22:32
-
-
Save yelizariev/0ea45bed982bb68d1568d587b83ba590 to your computer and use it in GitHub Desktop.
monitoring tools
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
sudo apt install lolcat cowsay | |
while true; do export PINGHOST=8.8.8.8 && RESULT=$(ping -q -n -c 4 $PINGHOST | awk '/packet loss/ {if ($6 != "0%") print $6, "packet loss"}') && echo "Done:" && if [[ -z $RESULT ]]; then cowsay "No package lost!" | lolcat --seed=45; else cowsay $RESULT | lolcat --seed=17; fi; date; echo -n "sleeping... "; sleep 5; echo -n "pinging... "; done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment