Skip to content

A Python script to capture speedtest-cli JSON and insert it into a database.

Notifications You must be signed in to change notification settings

aaronmelton/speedtest_monitor

Repository files navigation

Speedtest Monitor

A Python script to capture speedtest JSON and insert it into a database.

speedtest_monitor.png

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.

Prerequisites

  • speedtest binary from Ookla; I'm using the Linux binary here. (Installed automatically if using Dockerfile.)
  • MySQL database, built with the 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

Instructions For Use

Running Python Natively

  • 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

Authors