Skip to content

speedtest_to_superops.ps1

Corey Watson edited this page Dec 1, 2025 · 1 revision

speedtest_to_superops.ps1

Downloads and runs Ookla Speedtest CLI, captures network performance metrics, and synchronizes results to SuperOps.

Overview

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.

Purpose

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.

Prerequisites

  • 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

Configuration

Required Inputs

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

Data Sources & Priority

  1. Ookla Speedtest CLI (primary) - official binary from install.speedtest.net
  2. SuperOps custom fields (output) - decimal and text fields for metrics

Settings

Behavior

  1. Validates all hardcoded input values are present
  2. Creates extraction directory if it doesn't exist
  3. Downloads Speedtest CLI ZIP if speedtest.exe is not present
  4. Extracts ZIP archive and removes temporary ZIP file
  5. Executes speedtest with JSON output format (auto-accepts license/GDPR)
  6. Parses JSON results and calculates Mbps from bandwidth bytes
  7. Sends four custom fields to SuperOps: Download Speed, Upload Speed, ISP, URL
  8. Reports detailed metrics to console (ping, jitter, packet loss, server info)
  9. Exits 0 on success, exits 1 if any critical step fails

Security Notes

  • 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

Exit Codes

  • 0 = Success - speedtest completed and data sent to SuperOps
  • 1 = Failure - input validation, module import, download, extraction, speedtest, or sync failed

Example Output

[ 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 ]
--------------------------------------------------------------

Version History

  • 2025-10-31 v1.0.0 - Initial Style A compliant version with SuperOps integration

Links

Clone this wiki locally