Site icon Franky's Web

Ookla Speedtest.net and PowerShell

The company Ookla, with the well-known site speedtest.net for testing internet speed, also offers a tool for the command line. The tool itself can provide the output in JSON format and is therefore very suitable for passing the data on to various other applications. This makes it possible to create a nice overview of the Internet connection speed.

I have created a small Powershell script that processes the data from the Speedtest tool and prepares the output for PRTG, InfluxDB or as a CSV file. Maybe someone can use it, currently it is quite good to visualize the internet speed of different connections of the numerous home office users.

Here is an example from Chronograf or InfluxDB:

Or here the output as CSV file:

Examples for the script

The following syntax can be used to write the output to an InfluxDB. For the output to work, the PowerShell Influx Module required:

.\Speedtest.ps1 -Output INFLUXDB -InfluxDBHost "http://localhost:8086" -InfluxDBName "demo" -InfluxDBCredential (Get-Credential)

The following command can be used to write the data to a CSV file:

.\Speedtest.ps1 -Output CSV -CSVFile demo.txt

The script can also be used directly as a PRTG sensor, so that the data is output in PRTG format, it is sufficient to start the script with the parameter Output-Parameter PRTG:

 

.\Speedtest.ps1 -Output PRTG

 

Output to the console is also possible:

.\Speedtest.ps1 -Output TXT

And the output of the JSON data works with the output parameter "JSON". The JSON output provides a little more data, which can be processed accordingly:

.\Speedtest.ps1 -Output JSON

Download

A prerequisite for the script is the SpeedTest CLI from Ookla, if the data is to be exported to InfluxDB, the InfluxDB PowerShell module is also required:

Ookla Speedtest CLI

PowerShell Influx Module

The script itself can be downloaded here:

Exit mobile version