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
This repository contains useful docker-swarm-tools.

docker-swarm-tools This repository contains useful docker-swarm-tools. swarm-guardian This Docker image is intended to be used in a multihost docker e

NeuroForge GmbH & Co. KG 4 Jan 12, 2022
Visual disk-usage analyser for docker images

whaler What? A command-line tool for visually investigating the disk usage of docker images Why? Large images are slow to move and expensive to store.

Treebeard Technologies 194 Sep 01, 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
Ajenti Core and stock plugins

Ajenti is a Linux & BSD modular server admin panel. Ajenti 2 provides a new interface and a better architecture, developed with Python3 and AngularJS.

Ajenti Project 7k Jan 03, 2023
A Simple script to hunt unused Kubernetes resources.

K8SPurger A Simple script to hunt unused Kubernetes resources. Release History Release 0.3 Added Ingress Added Services Account Adding RoleBindding Re

Yogesh Kunjir 202 Nov 19, 2022
A charmed operator for running PGbouncer on kubernetes.

operator-template Description TODO: Describe your charm in a few paragraphs of Markdown Usage TODO: Provide high-level usage, such as required config

Canonical 1 Dec 01, 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
Wiremind Kubernetes helper

Wiremind Kubernetes helper This Python library is a high-level set of Kubernetes Helpers allowing either to manage individual standard Kubernetes cont

Wiremind 3 Oct 09, 2021
docker-compose工程部署时的辅助脚本

okta-cmd Introduction docker-compose 辅助脚本

完美风暴666 4 Dec 09, 2021
Webinar oficial Zabbix Brasil. Uma série de 4 aulas sobre API do Zabbix.

Repositório de scripts do Webinar de API do Zabbix Webinar oficial Zabbix Brasil. Uma série de 4 aulas sobre API do Zabbix. Nossos encontros [x] 04/11

Robert Silva 7 Mar 31, 2022
a CLI that provides a generic automation layer for assessing the security of ML models

Counterfit About | Getting Started | Learn More | Acknowledgments | Contributing | Trademarks | Contact Us -------------------------------------------

Microsoft Azure 575 Jan 02, 2023
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

Nick Barrett 2.1k Dec 29, 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
Official Python client library for kubernetes

Kubernetes Python Client Python client for the kubernetes API. Installation From source: git clone --recursive https://github.com/kubernetes-client/py

Kubernetes Clients 5.4k Jan 02, 2023
Universal Command Line Interface for Amazon Web Services

aws-cli This package provides a unified command line interface to Amazon Web Services. Jump to: Getting Started Getting Help More Resources Getting St

Amazon Web Services 13.3k Jan 01, 2023
GitGoat enables DevOps and Engineering teams to test security products intending to integrate with GitHub

GitGoat is an open source tool that was built to enable DevOps and Engineering teams to design and implement a sustainable misconfiguration prevention strategy. It can be used to test with products w

Arnica 149 Dec 22, 2022
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

Giampaolo Rodola 9k Jan 02, 2023
ServerStatus 云探针、多服务器探针、云监控、多服务器云监控

ServerStatus 云探针、多服务器探针、云监控、多服务器云监控 基于ServerStatus-Hotaru膜改版的套娃膜改版(实际上本README也是抄它的)。 主要将client改为通过http提交数据,以及将服务端换成了php以便减小部署成本(PHP is the best!) 默认图片

shirakun 16 Apr 14, 2022