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
NixOps is a tool for deploying to NixOS machines in a network or cloud.

NixOps NixOps is a tool for deploying to NixOS machines in a network or the cloud. Key features include: Declarative: NixOps determines and carries ou

Nix/Nixpkgs/NixOS 1.2k Jan 02, 2023
Dynamic DNS service

About nsupdate.info https://nsupdate.info is a free dynamic DNS service. nsupdate.info is also the name of the software used to implement it. If you l

nsupdate.info development 880 Jan 04, 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
A system for managing CI data for Mozilla projects

Treeherder Description Treeherder is a reporting dashboard for Mozilla checkins. It allows users to see the results of automatic builds and their resp

Mozilla 235 Dec 22, 2022
A declarative Kubeflow Management Tool inspired by Terraform

🍭 KRSH is Alpha version, so many bugs can be reported. If you find a bug, please write an Issue and grow the project together! A declarative Kubeflow

Riiid! 128 Oct 18, 2022
Copy a Kubernetes pod and run commands in its environment

copypod Utility for copying a running Kubernetes pod so you can run commands in a copy of its environment, without worrying about it the pod potential

Memrise 4 Apr 08, 2022
Chartreuse: Automated Alembic migrations within kubernetes

Chartreuse: Automated Alembic SQL schema migrations within kubernetes "How to automate management of Alembic database schema migration at scale using

Wiremind 8 Oct 25, 2022
Automatically capture your Ookla Speedtest metrics and display them in a Grafana dashboard

Speedtest All-In-One Automatically capture your Ookla Speedtest metrics and display them in a Grafana dashboard. Getting Started About This Code This

Aaron Melton 2 Feb 22, 2022
Dockerized iCloud drive

iCloud-drive-docker is a simple iCloud drive client in Docker environment. It uses pyiCloud python library to interact with iCloud

Mandar Patil 376 Jan 01, 2023
Ansible Collection: A collection of Ansible Modules and Lookup Plugins (MLP) from Linuxfabrik.

ansible_mlp An Ansible collection of Ansible Modules and Lookup Plugins (MLP) from Linuxfabrik. Ansible Bitwarden Item Lookup Plugin Returns a passwor

Linuxfabrik 2 Feb 07, 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 08, 2023
Rundeck / Grafana / Prometheus / Rundeck Exporter integration demo

Rundeck / Prometheus / Grafana integration demo via Rundeck Exporter This is a demo environment that shows how to monitor a Rundeck instance using Run

Reiner 4 Oct 14, 2022
Python IMDB Docker - A docker tutorial to containerize a python script.

Python_IMDB_Docker A docker tutorial to containerize a python script. Build the docker in the current directory: docker build -t python-imdb . Run the

Sarthak Babbar 1 Dec 30, 2021
A collection of beginner-friendly DevOps content

mansion Mansion is just a testing repo for learners to commit into open source project. These are the steps you need to learn: Please do not edit thes

Bryan Lim 62 Nov 30, 2022
Oncall is a calendar tool designed for scheduling and managing on-call shifts. It can be used as source of dynamic ownership info for paging systems like http://iris.claims.

Oncall See admin docs for information on how to run and manage Oncall. Development setup Prerequisites Debian/Ubuntu - sudo apt-get install libsasl2-d

LinkedIn 928 Dec 22, 2022
Utilitaire de contrôle de Kubernetes

Utilitaire de contrôle de Kubernetes ** What is this ??? ** Every time we use a word in English our manager tells us to use the French translation of

Théophane Vié 9 Dec 03, 2022
🎡 Build Python wheels for all the platforms on CI with minimal configuration.

cibuildwheel Documentation Python wheels are great. Building them across Mac, Linux, Windows, on multiple versions of Python, is not. cibuildwheel is

Python Packaging Authority 1.3k Jan 02, 2023
Automate SSH in python easily!

RedExpect RedExpect makes automating remote machines over SSH very easy to do and is very fast in doing exactly what you ask of it. Based on ssh2-pyth

Red_M 19 Dec 17, 2022
Deploying a production-ready Django project using Nginx and Gunicorn

django-nginx-gunicorn This project is for deploying a production-ready Django project using Nginx and Gunicorn. Running a local server of Django is no

Arash Sayareh 8 Jul 03, 2022
The low-level, core functionality of boto 3.

botocore A low-level interface to a growing number of Amazon Web Services. The botocore package is the foundation for the AWS CLI as well as boto3. On

the boto project 1.2k Jan 03, 2023