Last active
November 5, 2021 17:06
-
-
Save digitalpardoe/5481339 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
git clone git://github.com/sivel/speedtest-cli.git speedtest-cli |
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
0,20,40 * * * * root /usr/local/speedtest-cli/speedtest-cli --simple > /tmp/speedtest.out |
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 | |
echo "graph_category network" | |
echo "graph_title Speedtest" | |
echo "graph_args --base 1000 -l 0" | |
echo "graph_vlabel DL / UL" | |
echo "graph_scale no" | |
echo "down.label DL" | |
echo "down.type GAUGE" | |
echo "down.draw LINE1" | |
echo "up.label UL" | |
echo "up.type GAUGE" | |
echo "up.draw LINE1" | |
echo "graph_info Graph of Internet Connection Speed" | |
OUTPUT=`cat /tmp/speedtest.out` | |
DOWNLOAD=`echo "$OUTPUT" | grep Download | sed 's/[a-zA-Z:]* \([0-9]*\.[0-9]*\) [a-zA-Z/]*/\1/'` | |
UPLOAD=`echo "$OUTPUT" | grep Upload | sed 's/[a-zA-Z:]* \([0-9]*\.[0-9]*\) [a-zA-Z/]*/\1/'` | |
echo "down.value $DOWNLOAD" | |
echo "up.value $UPLOAD" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey, thank you for this script! The scriptname used in cron seems to be wrong:
I also added PING as an additional graph:
https://gist.github.com/deveth0/3dae2c52719e63560152