Simple daemon for tracking network speed with ookla speedtest and exporting the metrics to prometheus
Go to file
2024-10-20 05:10:53 -04:00
.gitignore First version 2024-10-19 15:43:07 +02:00
go.mod First version 2024-10-19 15:43:07 +02:00
go.sum First version 2024-10-19 15:43:07 +02:00
main.go First version 2024-10-19 15:43:07 +02:00
README.md Fix typo in README 2024-10-20 05:10:53 -04:00

Speedporter

A simple daemon that executes the Ookla Speedtest CLI and exposes the metrics via a Prometheus Exporter.

Dependencies

Install the Ookla Speedtest CLI

Build Dependencies

  • go

Build/Installation

  • git clone https://git.sdf.org/CRThaze/speedporter
  • cd speedporter
  • go build
  • Copy speedporter executable to the desired installation location. Perhaps:
    • /usr/local/bin
    • /opt/speedporter
    • ~/.local/bin

Usage

The following environment variables can be used to configure the daemon:

Name Default Description
SPEEDTEST_METRICS_LISTEN_PORT 9090 Which port to bind to for serving metrics
SPEEDTEST_METRICS_LISTEN_ADDR 0.0.0.0 Which address to bind to for serving metrics
SPEEDTEST_PERIOD_MINS 5 How often to run the test
SPEEDTEST_EXEC /usr/bin/speedtest The Path to the Ookla Speedtest Executable

SystemD Daemon

Here's an example Unit File you can use for SystemD

[Unit]
Description=Speedtest Metrics Reporter
After=network.target

[Service]
Type=simple
ExecStart=/opt/speedporter/speedporter
Restart=always
RestartSec=10
Environment="SPEEDTEST_METRICS_LISTEN_PORT=9091"

[Install]
WantedBy=default.target
  • Create this unit file in /etc/systemd/system/speedporter.service
  • Then run: systemd enable speedporter
  • And start it with: systemd start speedporter