The Imprivata Failed Device Monitor is a macOS-based automation script that checks the real-time status of iPhones managed through Imprivata GroundControl. It tracks key checkout states — Checked In
, Checked Out
, Overdue
, and Failed
.
When failed devices are detected, the script can automatically reboot them via the Workspace ONE API (if the number is below a safe threshold).
- Queries GroundControl API for all iOS devices
- Tracks and categorizes device checkout status
- Displays status counts and lists serials of failed/overdue devices
- Automatically reboots failed devices via Workspace ONE (optional, safe-guarded)
- Native macOS sound + dialog alerts (when interactive)
- Designed for background execution via LaunchAgent (every 4 hours)
- macOS (tested on Monterey and later)
jq
command-line utility
Install via Homebrew:brew install jq
This script uses both:
- A GroundControl API Key (URL param)
- Workspace ONE OAuth credentials (Client ID + Secret)
⚠️ Important: This script should be stored and executed on a secure, trusted machine.
If deploying more broadly, use an external secrets manager or.env
file to handle credentials securely and avoid hardcoding secrets directly into the script.
To run the monitor automatically every 4 hours:
-
Copy the sanitized LaunchAgent to your Mac:
~/Library/LaunchAgents/com.imprivata.groundcontroldevicemonitor.plist
-
Load the LaunchAgent:
launchctl load ~/Library/LaunchAgents/com.imprivata.groundcontroldevicemonitor.plist
-
Verify it's loaded:
launchctl list | grep groundcontroldevicemonitor
-
Logs are saved to:
- Standard Output:
/Users/yourusername/scripts/Imprivata_FailedDevice_Monitor/Imprivata_FailedDevice_Monitor.out
- Standard Error:
/Users/yourusername/scripts/Imprivata_FailedDevice_Monitor/Imprivata_FailedDevice_Monitor.err
- Standard Output:
Imprivata_FailedDevice_Monitor/
├── Imprivata_FailedDevice_Monitor.sh # Main script
├── com.imprivata.groundcontroldevicemonitor.plist # LaunchAgent for scheduling
├── reponomadx-logo.jpg # Logo
Brian Irish
GitHub: @brianirish
This project is licensed under the MIT License.
Feel free to open issues, suggest improvements, or fork the project if you’d like to contribute.
This script was built for real-world enterprise use — hope it helps others streamline GroundControl workflows just like it did for us.