https://github.com/aaronmelton/speedtest_monitor
A Python script to capture speedtest-cli JSON and insert it into a database.
https://github.com/aaronmelton/speedtest_monitor
docker docker-compose grafana grafana-dashboard mariadb monitoring mysql python speedtest speedtest-cli speedtest-python
Last synced: 22 days ago
JSON representation
A Python script to capture speedtest-cli JSON and insert it into a database.
- Host: GitHub
- URL: https://github.com/aaronmelton/speedtest_monitor
- Owner: aaronmelton
- Created: 2022-01-17T18:39:32.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2025-10-22T23:48:37.000Z (4 months ago)
- Last Synced: 2025-10-23T01:22:11.601Z (4 months ago)
- Topics: docker, docker-compose, grafana, grafana-dashboard, mariadb, monitoring, mysql, python, speedtest, speedtest-cli, speedtest-python
- Language: Python
- Homepage:
- Size: 547 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README

# Speedtest Monitor
A Python script to capture speedtest JSON and insert it into a database.
## Getting Started
### About This Code
This script was written to track internet speed using Ookla's speed test.
This repository contains the SQL schema and the Grafana dashboard JSON, so you can track your own metrics.
### Requirements
* [speedtest binary from Ookla](https://www.speedtest.net/apps/cli); I'm using the Linux binary here. (Installed automatically if using Dockerfile.)
* MySQL database, built with the [database/speedtest_database.sql](https://github.com/aaronmelton/speedtest_monitor/blob/master/database/speedtest_database.sql) schema, to store results.
* Set environment variables (DB_HOST, DB_USERNAME, DB_PASSWORD) in `docker-compose.yml` OR in your environment if not using Docker.
#### Python Libraries
* See [pyproject.toml](pyproject.toml)
### Instructions For Use
#### Python Commands
* To run the Python script:
`python speedtest_monitor.py`
#### Grafana
* In order to use the provided `grafana_dashboard.json` file, you'll need to use the SQL schema provided in `speedtest_database.sql` AND a Grafana MySQL Data Source named "SpeedTest".
## Acknowledgements
* Grafana dashboard layout borrowed from [speedtest_exporter](https://github.com/danopstech/speedtest_exporter).
## Authors
* **Aaron Melton** - *Author* - Aaron Melton