This script monitors network data usage per process on macOS using nettop
, and notifies you via native macOS notifications if any process exceeds a specified data threshold (default: 5 GB).
- Monitors all active processes and their network usage
- Sends a visible macOS notification using
terminal-notifier
- Configurable threshold (in bytes)
- Easy to run manually or schedule periodically via
cron
orlaunchd
- macOS (tested on Monterey and Ventura)
terminal-notifier
- Bash (macOS default is fine)
git clone https://github.com/dmahmouali/macOS-Network-Usage-Notifier.git
cd macOS-Network-Usage-Notifier
chmod +x network_usage_notifier.sh
brew install terminal-notifier
To receive notifications, ensure terminal-notifier is allowed in System Settings:
System Settings → Notifications → terminal-notifier
- ✅ Enable Allow Notifications
- 📢 Choose Banners or Alerts
- ✅ Enable Show in Notification Center and Play sound for notification
Open network_usage_notifier.sh
in a text editor. Near the top:
# Threshold in bytes (default: 5 GB)
THRESHOLD=$((5 * 1024 * 1024 * 1024))
You can change 5 to any value you want (e.g., for 1 GB):
THRESHOLD=$((1 * 1024 * 1024 * 1024))
Run crontab -e
and add:
*/10 * * * * /path/to/network_usage_notifier.sh
This runs the script every 10 minutes.
Ask in issues or check the launchd example in the extras/ folder.
Process Microsoft Teams.968 transferred over 5 GB
You'll also get a macOS popup.
MIT
PRs are welcome! Please ensure compatibility with default macOS bash and limit external dependencies.