A simple speedtest-cli (Ookla) report generator.
The purpose is to monitor internet speed over time. The goal is to assess whether the quality provided by internet service providers matches the advertised speed.
This project includes a robust Python wrapper (monitor/monitor.py) for the Ookla Speedtest CLI.
It runs the CLI, parses all JSON output lines (including errors), and logs results with timestamps in speedtests.jsonl.
-
Install Ookla Speedtest CLI
See Ookla CLI install instructions or use Homebrew:brew tap teamookla/speedtest brew install speedtest --force
-
Install Python dependencies
python -m venv venv source venv/bin/activate pip install -r requirements.txt -
Run the monitor
python monitor/monitor.py
Results are appended to
speedtests.jsonlin JSON Lines format.
You can deploy the monitor and automated reporting to a Raspberry Pi (or other Linux host) using the provided deployment script.
-
Edit
deploy.shif needed
AdjustREMOTE_USER,REMOTE_HOST, and paths if your setup differs. -
Run the deployment script
./deploy.sh
This will:
- Copy all project files to the remote host
- Set up a Python virtual environment and install dependencies
- Install Ookla Speedtest CLI if needed
- Set up cron jobs to run the monitor and generate the HTML report hourly
- Install and enable a systemd service to serve the report via HTTP
-
Access the report
Open in your browser:http://berri:8080/report.html(Replace
berriwith your Pi's hostname or IP if needed.)
This project uses pytest for testing.
To run tests:
pytest monitor/tests/If you want to explore the data interactively:
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
jupyter notebookOpen analysis/analysis.ipynb in Jupyter.
To manually generate the HTML report:
source venv/bin/activate
jupyter nbconvert --to html --theme dark analysis/analysis.ipynb --output analysis/report.htmlThe HTTP server is managed by a systemd service (speed-report.service).
You can check its status on the Pi with:
sudo systemctl status speed-report.service- If you cannot access the report from another device, check your firewall and ensure the service is running.
- The cron logs are available at
/opt/speed-monitor/cron.logon the Pi.
MIT