Automatically capture your Ookla Speedtest metrics and display them in a Grafana dashboard

Overview

Speedtest All-In-One

Automatically capture your Ookla Speedtest metrics and display them in a Grafana dashboard.

speedtest_monitor.png

Getting Started

About This Code

This script was written to track internet speed using Ookla's speed test.

This repository contains everything necessary to build your own Speedtest dashboard (Python script, SQLite database, Grafana dashboard).

Total application size is less than 450MB! ~276MB for Grafana; ~153MB for Python/SQLite

Dashboard and Database data is persistent through the use of Docker Volumes.

Prerequisites

  • Docker Engine
  • Docker host must be able to access Docker Hub

Python Libraries

Instructions For Use

  • Clone this repository.
  • Modify the speedtest_aio-cron file to adjust your test interval. The default is 15 minutes. Visit crontab.guru for an example on cron scheduling syntax.
  • Modify the Test Results panel in Grafana to match the values for your Internet connection. The default is set to 75Mb/s down and 25Mb/s up (which happen to be my Internet speed). Edit the Test Results panel, goto the Overrides and change the Max values for all Overrides to fit your situation. (This will change the gradient levels for download_throughput, upload_throughput and ping_latency.)

Docker Commands

  • To pull/build the necessary Docker images: docker-compose build

  • To run the application: docker-compose up -d

  • To stop the application: docker-compose down

Grafana

  • Default username/password is admin/admin.
  • You will be prompted to change your password upon first login.
  • Access your Grafana dashboard via http://localhost:3000 OR replace localhost with the IP Address of the host.
  • WARNING This dashboard will be accessible to all hosts in the same subnet!

Acknowledgements

Authors

You might also like...
Lima is an alternative to using Docker Desktop on your Mac.
Lima is an alternative to using Docker Desktop on your Mac.

lima-xbar-plugin Table of Contents Description Installation Dependencies Lima is an alternative to using Docker Desktop on your Mac. Description This

A tool to convert AWS EC2 instances back and forth between On-Demand and Spot billing models.
A tool to convert AWS EC2 instances back and forth between On-Demand and Spot billing models.

ec2-spot-converter This tool converts existing AWS EC2 instances back and forth between On-Demand and 'persistent' Spot billing models while preservin

Iris is a highly configurable and flexible service for paging and messaging.
Iris is a highly configurable and flexible service for paging and messaging.

Iris Iris core, API, UI and sender service. For third-party integration support, see iris-relay, a stateless proxy designed to sit at the edge of a pr

StackStorm (aka pyinfra automates infrastructure super fast at massive scale. It can be used for ad-hoc command execution, service deployment, configuration management and more.
pyinfra automates infrastructure super fast at massive scale. It can be used for ad-hoc command execution, service deployment, configuration management and more.

pyinfra automates/provisions/manages/deploys infrastructure super fast at massive scale. It can be used for ad-hoc command execution, service deployme

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:

Latest Salt Documentation Open an issue (bug report, feature request, etc.) Salt is the world’s fastest, most intelligent and scalable automation engi

Simple, Pythonic remote execution and deployment.

Welcome to Fabric! Fabric is a high level Python (2.7, 3.4+) library designed to execute shell commands remotely over SSH, yielding useful Python obje

Cross-platform lib for process and system monitoring in Python
Cross-platform lib for process and system monitoring in Python

Home Install Documentation Download Forum Blog Funding What's new Summary psutil (process and system utilities) is a cross-platform library for retrie

This repository contains code examples and documentation for learning how applications can be developed with Kubernetes

BigBitBus KAT Components Click on the diagram to enlarge, or follow this link for detailed documentation Introduction Welcome to the BigBitBus Kuberne

Comments
  • Default Dashboard Isn't Loading In Grafana

    Default Dashboard Isn't Loading In Grafana

    While testing a new Dockerfile for the speedtest based on the Alpine image I noticed the default dashboard isn't loading into the Grafana image. This was known to be working prior to v0.3.1 but neither change in v0.3.1 influenced the creation of the Grafana image so I'm uncertain what introduced this issue. Investigating...

    bug 
    opened by aaronmelton 3
  • sqlite error

    sqlite error

    I tried to fugure this out by myself, but I'm unfortunately new to Docker and Grafan and am more used to Lua and C++ then Python :( When i try to run this as stated in another issue the Dashborad does not load completly, specifically it can't load data.

    Bild_2022-02-18_094245

    image

    Going through the logs the speedtest_grafana container I was able to find what I think causes the problem:

    logger=sqlstore t=2022-02-18T08:02:09.9+0000 lvl=info msg="Connecting to DB" dbtype=sqlite3

    logger=migrator t=2022-02-18T08:02:09.91+0000 lvl=info msg="Starting DB migrations"

    logger=migrator t=2022-02-18T08:02:09.92+0000 lvl=info msg="migrations completed" performed=0 skipped=381 duration=459.934µs

    And a little later: 18T08:05:18.44+0000 lvl=eror msg="Could not execute query" err="unable to open database file: no such file or directory" query="SELECT\n timestamp AS \"time\",\n avg(download_bandwidth)\nFROM speedtest\nORDER BY timestamp"

    Here are the complete logs I was looking at. The restart request for the plugin does not go away when: - restarting the speedtest_grafana container - restarting the speedtest_aio container - restarting speedtest_aio-master - Restarting docker and the docker engine - restarting the entire PC

    Bild_2022-02-18_092321 Bild_2022-02-18_093100

    Most other error before, such as Grafana not loading, Dashboard not accessible were able to be treated by restarting a view times (probably some kind of restart requirments for Plugins. as given on the very top of the first page)

    Sadly the speedtest_aio container for me has no logged events what so ever, eventhough my guess after looking through the volume and checking the place the database is supposed to be stored the this container should have the sqlite file, but the var/lib//db directory where the database should be is empty.

    Bild_2022-02-18_094659

    I then ended up looking at the speedtest_aio.py file and realisedt, that non of the errors defined in there and related to the database where thrown.

    Since I don't know python to well the only Ideas I have at this point are:

    • The file is never run thus not creating the database
    • On the webpage of sqlite it states to create a new file with squlite test.db however teting .sqlite was no problem during my testing.

    I hope the data provided can help solving it (or you can tell me what I can do to fix it) :)

    opened by NewtonsScan 12
Releases(v0.4.2)
  • v0.4.2(Feb 22, 2022)

    This version is not backward-compatible with the volumes created by the v0.3 train!

    [0.4.2] - 2022-02-22

    Changed

    • README.md: Improved spacing for Docker commands.
    • Updating click (8.0.3 -> 8.0.4)
    • Updating gitpython (3.1.26 -> 3.1.27)
    • Updating platformdirs (2.4.1 -> 2.5.1)
    • Updating typing-extensions (4.0.1 -> 4.1.1)

    [0.4.1] - 2022-02-22

    Changed

    • Dockerfile-speedtest: Added prune label to the base image build.
    • grafana/grafana_dashboard.json: Sorting test list by descending time.
    • README.md: Improved instructions for Docker operation.
    • speedtest_monitor.png: New screenshot to reflect new layout.

    [0.4.0] - 2022-02-21

    Changed

    • docker-compose.yml: Updating paths to match changes in application.
    • Dockerfile-grafana: Added ownership flags to COPY command.
    • Dockerfile-speedtest-RPi: Replacing speedtest_aio-cron with crontab.
    • Dockerfile-speedtest: Updated for use in Alpine Linux.
    • grafana/datasource.yml: Updating paths to match changes in application.
    • grafana/grafana_dashboard.json: Updating to match changes to code.
    • README.md: Improved instructions for Docker operation.
    • speedtest_aio-cron: Updated for use in Alpine Linux.
    • speedtest_aio.py: create_database(): Removed fields that are no longer being tracked.
    Source code(tar.gz)
    Source code(zip)
Owner
Aaron Melton
Aaron Melton
Let's learn how to build, release and operate your containerized applications to Amazon ECS and AWS Fargate using AWS Copilot.

?? Welcome to AWS Copilot Workshop In this workshop, you'll learn how to build, release and operate your containerised applications to Amazon ECS and

Donnie Prakoso 15 Jul 14, 2022
Glances an Eye on your system. A top/htop alternative for GNU/Linux, BSD, Mac OS and Windows operating systems.

Glances - An eye on your system Summary Glances is a cross-platform monitoring tool which aims to present a large amount of monitoring information thr

Nicolas Hennion 22k Jan 8, 2023
A little script and trick to make your heroku app run forever without being concerned about dyno hours.

A little script and trick to make your heroku app run forever without being concerned about dyno hours.

Tiararose Biezetta 152 Dec 25, 2022
Manage your SSH like a boss.

--- storm is a command line tool to manage your ssh connections. features adding, editing, deleting, listing, searching across your SSHConfig. command

Emre Yılmaz 3.9k Jan 3, 2023
A Kubernetes operator that creates UptimeRobot monitors for your ingresses

This operator automatically creates uptime monitors at UptimeRobot for your Kubernetes Ingress resources. This allows you to easily integrate uptime monitoring of your services into your Kubernetes deployments.

Max 49 Dec 14, 2022
Nagios status monitor for your desktop.

Nagstamon Nagstamon is a status monitor for the desktop. It connects to multiple Nagios, Icinga, Opsview, Centreon, Op5 Monitor/Ninja, Checkmk Multisi

Henri Wahl 361 Jan 5, 2023
Manage your azure VM easily!

Azure-manager Manage your VM in Azure using cookies.

Team 1injex 129 Dec 17, 2022
Knock your images before these make you painful.

image-knocker Knock your images before these make you painful. Background One day, I had run my deep learning model training program and got off work

Yonghye Kwon 9 Jul 25, 2022