0

Track Download and Upload Speeds of your managed Macs in Jamf Pro

Terminal

One situation I’ve come across is wanting to know what kind of network situations the fleet under my care is under. In macOS Monterey, this became possible with the new command: networkQuality. This command measures network statistics of a macOS device much like a web-based speed test and is therefore very useful for Mac users to quickly test their network speeds by firing up Terminal and typing that command in and hitting the return key. This also makes it relatively easy to track in a whole fleet by creating an extension attribute in Jamf Pro.

The scripts below are what I wrote and use:

#!bin/bash
#Measure Download speed in Mbps of a macOS device

DownloadSpeed=$(/usr/bin/networkQuality | awk '/Download capacity/{print $3}')

echo "<result>$DownloadSpeed</result>"
#!bin/bash
#Measure Upload speed in Mbps of a macOS device

UploadSpeed=$(/usr/bin/networkQuality | awk '/Upload capacity/{print $3}')

echo "<result>$UploadSpeed</result>"

How would knowing the download and upload speeds of Macs in your fleet help you?

Essentially, every time they check-in with Jamf Pro, it will run a speed test and report these results at that point in time to Jamf Pro. If you have significantly large packages that you would only want to deploy when Macs in your fleet have a good connection and avoid those that don’t, these scripts will help create extension attributes that can be used with Smart Groups to target Macs that meet such criteria.

These scripts work in all versions of macOS Monterey and Big Sur. They don’t seem to work on macOS Ventura VMs on Apple Silicon though. Come this Monday, October the 24th, I’m sure I’ll have plenty of opportunity to test its effectiveness on physical devices.

Leave a Reply

Your email address will not be published. Required fields are marked *