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
Build Netbox as a Docker container

netbox-docker The Github repository houses the components needed to build Netbox as a Docker container. Images are built using this code and are relea

Farshad Nick 1 Dec 18, 2021
Bash-based Python-venv convenience wrapper

venvrc Bash-based Python-venv convenience wrapper. Demo Install Copy venvrc file to ~/.venvrc, and add the following line to your ~/.bashrc file: # so

1 Dec 29, 2022
A repository containing a short tutorial for Docker (with Python).

Docker Tutorial for IFT 6758 Lab In this repository, we examine the advtanges of virtualization, what Docker is and how we can deploy simple programs

Arka Mukherjee 0 Dec 14, 2021
Project 4 Cloud DevOps Nanodegree

Project Overview In this project, you will apply the skills you have acquired in this course to operationalize a Machine Learning Microservice API. Yo

1 Nov 21, 2021
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

Fabric 13.8k Jan 06, 2023
Tiny Git is a simplified version of Git with only the basic functionalities to gain better understanding of git internals.

Tiny Git is a simplified version of Git with only the basic functionalities to gain better understanding of git internals. Implemented Functi

Ahmed Ayman 2 Oct 15, 2021
📦 Powerful Package manager which updates plugins & server software for minecraft servers

pluGET A powerful package manager which updates Plugins and Server Software for minecraft servers. Screenshots check all to check installed plugins fo

106 Dec 16, 2022
Learning and experimenting with Kubernetes

Kubernetes Experiments This repository contains code that I'm using to learn and experiment with Kubernetes. 1. Environment setup minikube kubectl doc

Richard To 10 Dec 02, 2022
Jenkins-AWS-CICD - Implement Jenkins CI/CD with AWS CodeBuild and AWS CodeDeploy, build a python flask web application.

Jenkins-AWS-CICD - Implement Jenkins CI/CD with AWS CodeBuild and AWS CodeDeploy, build a python flask web application.

Ning 1 Jan 01, 2022
Kubediff: a tool for Kubernetes to show differences between running state and version controlled configuration.

Kubediff: a tool for Kubernetes to show differences between running state and version controlled configuration.

Weaveworks 1.1k Dec 30, 2022
🐳 RAUDI: Regularly and Automatically Updated Docker Images

🐳 RAUDI: Regularly and Automatically Updated Docker Images RAUDI (Regularly and Automatically Updated Docker Images) automatically generates and keep

SecSI 534 Dec 29, 2022
Cobbler is a versatile Linux deployment server

Cobbler Cobbler is a Linux installation server that allows for rapid setup of network installation environments. It glues together and automates many

Cobbler 2.4k Dec 24, 2022
Self-hosted, easily-deployable monitoring and alerts service - like a lightweight PagerDuty

Cabot Maintainers wanted Cabot is stable and used by hundreds of companies and individuals in production, but it is not actively maintained. We would

Arachnys 5.4k Dec 23, 2022
Quick & dirty controller to schedule Kubernetes Jobs later (once)

K8s Jobber Operator Quickly implemented Kubernetes controller to enable scheduling of Jobs at a later time. Usage: To schedule a Job later, Set .spec.

Jukka Väisänen 2 Feb 11, 2022
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
CTF infrastructure deployment automation tool.

CTF infrastructure deployment automation tool. Focus on the challenges. Mirrored from

Fake News 1 Apr 12, 2022
Oracle Cloud Infrastructure Object Storage fsspec implementation

Oracle Cloud Infrastructure Object Storage fsspec implementation The Oracle Cloud Infrastructure Object Storage service is an internet-scale, high-per

Oracle 9 Dec 18, 2022
A cpp project template that uses CMake to build and Google Test / Github Actions to provide a CI

A cpp project template that uses CMake to build and Google Test / Github Actions to provide a CI

Martin Olivier 6 Nov 17, 2022