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:
The script itself can be downloaded here:
Wie bekommt man die Daten eigentlich zu Influxdb Cloud? Habe mich da kostenlos angemeldet und eine Datenbank erstellt. Aber welche url und Credentials muss ich da nun eingeben?
Funktioniert super, aber wie bekomme ich das hin, dass mir ein Output in einer Datei automatisch mit der Aufgabenplanung erstellt wird? Für einen Tipp wäre ich Dankbar.
Moin,
das sieht ja sehr interessant aus. Hast du einen Hinweis oder eine Quelle, wo beschrieben wird wie das ganze in PRTG eingebunden werden kann?
LG
Scheinbar mag PRTG das Script nicht sonderlich.
Mehr als: XML: Das zurückgelieferte XML entspricht nicht dem erwarteten Schema. (Code: PE233) — JSON: Das zurückgelieferte JSON entspricht nicht der erwarteten Struktur (Invalid JSON.). (Code: PE231) kommt bei mir nicht raus.