Created
December 28, 2017 15:08
-
-
Save SkaTeMasTer/b764b32365c9aab36a44c7c33b6197e3 to your computer and use it in GitHub Desktop.
Create a log file entry for speedtest-cli. Place this in /etc/cron.hourly directory for continuous logging coolness. Reports ping time, and upload / download speed.
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/sh | |
MSG=`speedtest-cli --simple | perl -pe 's/^(.*): (.*) (.*?)(\/s)?\n/"$1_$3": $2, /m' | cut -d',' -f 1-3` | |
logger "{\"speed\": {$MSG}}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Outputs JSON entry in /var/log/syslog:
Dec 28 09:17:57 PiHoleVPN logger: {"speed": {"Ping_ms": 353.071, "Download_Mbits": 9.92, "Upload_Mbits": 8.23}}
I like to run it more often though... hmm. ;)