-
Notifications
You must be signed in to change notification settings - Fork 5
speedtest_to_superops.ps1
Corey Watson edited this page Dec 1, 2025
·
1 revision
Downloads and runs Ookla Speedtest CLI, captures network performance metrics, and synchronizes results to SuperOps.
Downloads and runs Ookla Speedtest CLI, captures network performance metrics, and synchronizes the results to SuperOps custom fields for monitoring and reporting. Designed for RMM automation to track internet connectivity quality.
Downloads and runs Ookla Speedtest CLI, captures network performance metrics, and synchronizes the results to SuperOps custom fields for monitoring and reporting. Designed for RMM automation to track internet connectivity quality.
- SuperOps PowerShell module must be available and authenticated
- Internet connectivity for downloading CLI and running speedtest
- Write permissions to $env:TEMP directory
- Windows OS with PowerShell 5.1+ or PowerShell 7+
- No admin privileges required
All inputs are hardcoded in the script body:
- $superOpsModule : SuperOps PowerShell module variable (non-empty string)
- $downloadUrl : Speedtest CLI download URL (valid HTTPS URL)
- $zipPath : Temporary ZIP file location (valid path string)
- $extractPath : CLI extraction directory (valid path string)
- $exePath : Path to speedtest.exe after extraction (valid path string)
SuperOps Custom Fields (must exist in tenant):
- "Download Speed" : Decimal field for Mbps download rate
- "Upload Speed" : Decimal field for Mbps upload rate
- "ISP" : Short Text field for ISP name
- "Speedtest URL" : Short Text field for result URL
- Ookla Speedtest CLI (primary) - official binary from install.speedtest.net
- SuperOps custom fields (output) - decimal and text fields for metrics
- Download URL : https://install.speedtest.net/app/cli/ookla-speedtest-1.2.0-win64.zip
- Extraction Path : $env:TEMP\SpeedtestCLI
- Speed Units : Mbps (megabits per second)
- Precision : Full decimal precision (no rounding)
- Timeout : Uses PowerShell defaults (Invoke-WebRequest, Expand-Archive)
- Validates all hardcoded input values are present
- Creates extraction directory if it doesn't exist
- Downloads Speedtest CLI ZIP if speedtest.exe is not present
- Extracts ZIP archive and removes temporary ZIP file
- Executes speedtest with JSON output format (auto-accepts license/GDPR)
- Parses JSON results and calculates Mbps from bandwidth bytes
- Sends four custom fields to SuperOps: Download Speed, Upload Speed, ISP, URL
- Reports detailed metrics to console (ping, jitter, packet loss, server info)
- Exits 0 on success, exits 1 if any critical step fails
- No secrets are printed to console output or logs
- External IP address is displayed but not sent to SuperOps (informational only)
- Speedtest CLI auto-accepts license and GDPR terms
- All network operations use HTTPS where applicable
- 0 = Success - speedtest completed and data sent to SuperOps
- 1 = Failure - input validation, module import, download, extraction, speedtest, or sync failed
[ INPUT VALIDATION ]
--------------------------------------------------------------
All required inputs are present
[ DOWNLOAD ]
--------------------------------------------------------------
Created extraction directory
Extraction Path : C:\Users\admin\AppData\Local\Temp\SpeedtestCLI
Downloading Speedtest CLI archive
Source URL : https://install.speedtest.net/app/cli/ookla-speedtest-1.2.0-win64.zip
Downloaded Speedtest CLI archive
Archive Size : 7.3 MB
[ EXTRACTION ]
--------------------------------------------------------------
Extracting Speedtest CLI archive
Extracted Speedtest CLI successfully
Executable Path : C:\Users\admin\AppData\Local\Temp\SpeedtestCLI\speedtest.exe
Removed temporary ZIP file
[ SPEED TEST ]
--------------------------------------------------------------
Executing speedtest (this may take 30-60 seconds)
Speedtest completed successfully
[ RESULTS ]
--------------------------------------------------------------
Download Speed : 357.32 Mbps
Upload Speed : 41.93 Mbps
Ping Latency : 12.5 ms
Ping Jitter : 0.8 ms
Packet Loss : 0%
ISP : Comcast Cable
External IP : 73.XXX.XXX.XXX
Server Name : Speedtest.net Server
Server Location : Seattle, WA
Server Host : speedtest.example.net
Server IP : 198.XXX.XXX.XXX
Result URL : https://www.speedtest.net/result/c/a1b2c3d4-e5f6
[ SUPEROPS SYNC ]
--------------------------------------------------------------
Sent Download Speed to SuperOps
Sent Upload Speed to SuperOps
Sent ISP to SuperOps
Sent Speedtest URL to SuperOps
All custom fields synchronized successfully
[ FINAL STATUS ]
--------------------------------------------------------------
Status : Success
Metrics captured and synchronized to SuperOps
[ SCRIPT COMPLETED ]
--------------------------------------------------------------
- 2025-10-31 v1.0.0 - Initial Style A compliant version with SuperOps integration
- View Script Source
- Scripts - Back to script index