Git Product home page Git Product logo

speeder's Introduction

Speeder

Build Lint

Python script to monitor your internet speed! ๐Ÿš€

Periodically run librespeed/speedtest-cli and send results to InfluxDB.

Quick Start

Note The assumption is made that you've already setup InfluxDB 2.x.x. Alternatively, you can use the Docker Compose method where this is setup for you.

List available server IDs:

docker run --rm -it ghcr.io/dbrennand/speeder:latest /librespeed --list

Next, start and configure speeder using the environment variables:

docker run -itd --rm --name speeder \
    -e "SPEEDER_SPEEDTEST_INTERVAL=300" \
    -e "SPEEDER_SPEEDTEST_SERVER_ID=49" \
    -e "SPEEDER_INFLUXDB_HOST=influx.example.com" \
    -e "SPEEDER_INFLUXDB_TOKEN=<Token>" \
    -e "SPEEDER_INFLUXDB_ORG=speeder" \
    -e "SPEEDER_INFLUXDB_BUCKET=speeder" \
    ghcr.io/dbrennand/speeder:latest

Environment Variables

The speeder script is configured using the below environment variables:

Name Description Default Value
SPEEDER_SPEEDTEST_INTERVAL Interval in seconds to run speedtests on. 300
SPEEDER_SPEEDTEST_SERVER_ID Server ID to run speedtests against. Supports multiple IDs using a comma separated string. ""
SPEEDER_INFLUXDB_HOST InfluxDB hostname. influxdb
SPEEDER_INFLUXDB_PORT InfluxDB port. 8086
SPEEDER_INFLUXDB_TOKEN InfluxDB token. root
SPEEDER_INFLUXDB_ORG InfluxDB organisation name. speeder
SPEEDER_INFLUXDB_BUCKET InfluxDB bucket name to write speedtest results to. speeder

Docker Compose Stack - InfluxDB and Grafana

The docker-compose.yml file in this repository will deploy speeder, InfluxDB 2.7.1 and Grafana containers. Grafana will be provisioned with InfluxDB as the data source and the pre-created dashboard:

Dashboard

Dashboard 1

  1. Set the SPEEDER_SPEEDTEST_SERVER_ID environment variable located in the .env file to the server IDs to perform speedtests against.

    Note

    If you don't know any server IDs, run the following command to list them:

    docker run --rm -it ghcr.io/dbrennand/speeder:latest /librespeed --list
  2. Set the DOCKER_INFLUXDB_INIT_PASSWORD, DOCKER_INFLUXDB_INIT_ADMIN_TOKEN and GF_SECURITY_ADMIN_PASSWORD environment variables located in the .env file.

  3. Start the compose stack:

    docker compose up -d

Grafana will be accessible at http://localhost:3000 and your host's IP address.

Disclaimer

I did NOT create the LibreSpeed project or CLI. The great folks over at LibreSpeed did.

If you like this project then please give their repositories a star! โญ

Authors -- Contributors

Daniel Brennand - Author

License

This project is licensed under the MIT License - see the LICENSE for details.

speeder's People

Contributors

dbrennand avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

speeder's Issues

Getting Error from speeder container

Hello,

i get the following error as soon as I start the docker stack

speeder   | 2023-10-18 02:00:59.492 | DEBUG    | __main__:<module>:91 - Speedtest for server ID: 78 succeeded.
speeder   | Traceback (most recent call last):
speeder   |   File "//speeder.py", line 104, in <module>
speeder   |     "server_name": json_result[0]["server"]["name"],
speeder   | TypeError: 'NoneType' object is not subscriptable
speeder exited with code 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.