A lightweight Grafana dashboard that reports results from Ookla's speedtest-cli.
- Ookla's speedtest-cli application
- Python 3
- InfluxDB
- Grafana
- Patience
This dasboard will provide you with detailed analytics in an easily digestable format. It includes a snapshot of the results from the speedtest last run as well as historical data for the following metrics:
- Download speed (Mbps)
- Upload speed (Mbps)
- Ping (ms)
- Jitter (ms)
- Packet loss (%)
In addition to the above performance indicators, data points displayed from the last run speedtest are:
- ISP - Verizon, Comcast, etc.
- Test Server - will display the server ID by default, but can be customized to display the server name
- Result URL - the url of the speedtest so you can share it with support staff, social media, etc.
For the best experience, please make sure you have the speedtest-cli script working, and InfluxDB and Grafana installed. This dashboard will do nothing until you have basic functionality and data storage in place first. If you need detailed instructions on how to do that, you can follow the dependency primer.
-
Install the dashboard using the JSON config file (
config.json
) logging into Grafana and hovering over the plus (+) icon in the left sidebar, clicking Import. Copy and paste the entire contents ofconfig.json
into the Import via panel json, then click Load. -
If this is a fresh install for you - meaning you've set the speedtest-cli script up from scratch along with InfluxDB and Grafana, now is a good time to test the ingest from the scrip to the database, seeing how the dashboard presents that data to you. To do this, you can spam
python3 speedtest.py
a few times on the command line (I recommend at least three or four passes). Once those test results are stored in the database, you can customize the rest of the dashboard to your liking. -
As the final step, you'll want to set the speedtest script to run at an interval you're comfortable with, automatically. To do this, we'll use
crontab -e
. If this is the first time you're running it, or you have a fresh install of Linux, do yourself a favor us select Nano as your editor. I run my speedtest every 30 minutes, but you may consider running it every hour or less if you're on a metered connection or your ISP has a data limitation.For a sample of the format you'll want to use:
30-minute interval
# m h dom mon dow command */30 * * * * python3 /home/pi/speedtest.py
60-minute interval
# m h dom mon dow command */60 * * * * python3 /home/pi/speedtest.py
2-hour interval
# m h dom mon dow command */120 * * * * python3 /home/pi/speedtest.py
N.B. - customize the directory where you have your Python script sitting.
pwd
andls -l
are your friends.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt for more information.
- PiMyLifeUp
- @djshadowxm82, for inspiring me to learn Python.