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
SSH tunnels to remote server.

Author: Pahaz Repo: https://github.com/pahaz/sshtunnel/ Inspired by https://github.com/jmagnusson/bgtunnel, which doesn't work on Windows. See also: h

Pavel White 1k Dec 28, 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
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
This project shows how to serve an TF based image classification model as a web service with TFServing, Docker, and Kubernetes(GKE).

Deploying ML models with CPU based TFServing, Docker, and Kubernetes By: Chansung Park and Sayak Paul This project shows how to serve a TensorFlow ima

Chansung Park 104 Dec 28, 2022
SSH to WebSockets Bridge

wssh wssh is a SSH to WebSockets Bridge that lets you invoke a remote shell using nothing but HTTP. The client connecting to wssh doesn't need to spea

Andrea Luzzardi 1.3k Dec 25, 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
Remote Desktop Protocol in Twisted Python

RDPY Remote Desktop Protocol in twisted python. RDPY is a pure Python implementation of the Microsoft RDP (Remote Desktop Protocol) protocol (client a

Sylvain Peyrefitte 1.6k Dec 30, 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
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
Tools and Docker images to make a fast Ruby on Rails development environment

Tools and Docker images to make a fast Ruby on Rails development environment. With the production templates, moving from development to production will be seamless.

1 Nov 13, 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 03, 2023
Get Response Of Container Deployment Kube with python

get-response-of-container-deployment-kube 概要 get-response-of-container-deployment-kube は、例えばエッジコンピューティング環境のコンテナデプロイメントシステムにおいて、デプロイ元の端末がデプロイ先のコンテナデプロイ

Latona, Inc. 3 Nov 05, 2021
Ingress patch example by Kustomize

Ingress patch example by Kustomize

Jinu 10 Nov 14, 2022
A cron monitoring tool written in Python & Django

Healthchecks Healthchecks is a cron job monitoring service. It listens for HTTP requests and email messages ("pings") from your cron jobs and schedule

Healthchecks 5.8k Jan 02, 2023
A colony of interacting processes

NColony Infrastructure for running "colonies" of processes. Hacking $ tox Should DTRT -- if it passes, it means unit tests are passing, and 100% cover

23 Apr 04, 2022
Prometheus exporter for AWS Simple Queue Service (SQS)

Prometheus SQS Exporter Prometheus exporter for AWS Simple Queue Service (SQS) Metrics Metric Description ApproximateNumberOfMessages Returns the appr

Gabriel M. Dutra 0 Jan 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
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
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