Created
June 24, 2022 23:09
-
-
Save acceptableEngineering/ed68c113bf2b61bc1e561b7d0dd18d6c to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
SPEEDTEST=$(/opt/homebrew/bin/speedtest -I en0 -f json) | |
RESULT=$(echo $SPEEDTEST | /opt/homebrew/bin/jq '.download.bandwidth') | |
/usr/local/bin/aws cloudwatch put-metric-data --namespace "The Eyeris" --metric-name SpeedTest-Download --value ${RESULT} --region us-west-2 | |
RESULT=$(echo $SPEEDTEST | /opt/homebrew/bin/jq '.upload.bandwidth') | |
/usr/local/bin/aws cloudwatch put-metric-data --namespace "The Eyeris" --metric-name SpeedTest-Upload --value ${RESULT} --region us-west-2 | |
RESULT=$(echo $SPEEDTEST | /opt/homebrew/bin/jq '.ping.latency') | |
/usr/local/bin/aws cloudwatch put-metric-data --namespace "The Eyeris" --metric-name SpeedTest-Ping --value ${RESULT} --region us-west-2 | |
RESULT=$(echo $SPEEDTEST | /opt/homebrew/bin/jq '.packetLoss') | |
/usr/local/bin/aws cloudwatch put-metric-data --namespace "The Eyeris" --metric-name SpeedTest-Loss --value ${RESULT} --region us-west-2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment