Created
December 12, 2016 13:35
-
-
Save drankard/e2384a87146b1e19015c9bb056bde8cb to your computer and use it in GitHub Desktop.
This file contains 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
total 1608 | |
#!/bin/bash | |
host=$1 | |
ping $host | while read pong; do | |
echo $pong | grep --line-buffered -o 'time=\S*' | \ | |
sed -e 's/time=//' | \ | |
xargs -I {} aws cloudwatch put-metric-data --namespace wifi-ping --metric-name ping-latency --dimensions "host=$host" --timestamp "$(date)" --unit Milliseconds --value {} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment