Sign inSign up

vasylgnatiuk/speedtest

By vasylgnatiuk

Updated 7 months ago

Script to periodically run the Speedtest CLI application by Ookla and post results to InfluxDB v2.0+

Image
Monitoring & observability
0

500

vasylgnatiuk/speedtest repository overview

Speedtest to InfluxDB v2.0

This is a Python script that will continuously run the official Speedtest CLI application by Ookla, takes input from environment variables, formats data and writes it to an InfluxDB database.

Configuring the container

The InfluxDB connection settings are controlled by environment variables.

The variables available are:

  • NAMESPACE = default - None
  • INFLUX_DB_ADDRESS = default - influxdb
  • INFLUX_DB_PORT = default - 8086
  • INFLUX_DB_ORG = default - {blank}
  • INFLUX_DB_TOKEN = default - {blank}
  • INFLUX_DB_DATABASE = default - speedtests
  • INFLUX_DB_TAGS = default - None * See below for options, '*' widcard for all *
  • SPEEDTEST_INTERVAL = default - 5 (minutes)
  • SPEEDTEST_SERVER_ID = default - {blank} * id from https://c.speedtest.net/speedtest-servers-static.php *
  • PING_INTERVAL = default - 5 (seconds)
  • PING_TARGETS = default - 1.1.1.1, 8.8.8.8 (csv of hosts to ping)
Variable Notes
  • Intervals are in minutes. Script will convert it to seconds.
  • If any variables are not needed, don't declare them. Functions will operate with or without most variables.
  • Tags should be input without quotes. INFLUX_DB_TAGS = isp, interface, external_ip, server_name, speedtest_url
  • NAMESPACE is used to collect data from multiple instances of the container into one database and select which you wish to view in Grafana. i.e. I have one monitoring my Starlink, the other my TELUS connection.
Tag Options

The Ookla speedtest app provides a nice set of data beyond the upload and download speed. The list is below.

Tag NameDescription
ispYour connections ISP
interfaceYour devices connection interface
internal_ipYour container or devices IP address
interface_macMac address of your devices interface
vpn_enabledDetermines if VPN is enabled or not? I wasn't sure what this represented
external_ipYour devices external IP address
server_idThe Speedtest ID of the server that was used for testing
server_nameName of the Speedtest server used for testing
server_countryCountry where the Speedtest server resides
server_locationLocation where the Speedtest server resides
server_hostHostname of the Speedtest server
server_portPort used by the Speedtest server
server_ipSpeedtest server's IP address
speedtest_idID of the speedtest results. Can be used on their site to see results
speedtest_urlLink to the testing results. It provides your results as it would if you tested on their site.
Additional Notes

Be aware that this script will automatically accept the license and GDPR statement so that it can run non-interactively. Make sure you agree with them before running.

Tag summary

Content type

Image

Digest

sha256:cadd0ffc5

Size

58 MB

Last updated

7 months ago

docker pull vasylgnatiuk/speedtest