macOS Installation Guide
Step-by-step guide to install TE Monitor agent on macOS
macOS Server Monitoring Setup
Supported Versions: macOS 10.12 (Sierra) and later versions.
1
Download the Monitoring Script
Download the macOS monitoring script to your Mac.
curl -O https://monitor.te.com.tr/downloads/te-monitor-macos.sh
Note: The script will be downloaded to your current directory.
2
Make Script Executable
Set execute permissions for the script.
chmod +x te-monitor-macos.sh
3
Install Required Dependencies
Install curl and bc packages if not already installed.
Using Homebrew (Recommended):
brew install curl bc
Using MacPorts:
sudo port install curl bc
Note: curl is usually pre-installed on macOS. If you don't have Homebrew, you can install it from brew.sh.
4
Get Your API Key
From the Servers page, click the key icon next to your server to get the API key.
API Key: You'll need this unique key to authenticate your Mac with the monitoring system.
5
Run the Monitoring Script
Start monitoring with your API key.
./te-monitor-macos.sh -k "YOUR_API_KEY"
Success: If everything is working correctly, you should see "SUCCESS: Metrics sent successfully" messages.
6
🚀 Run in Background (Production)
For production Macs, run the monitoring script silently in the background.
nohup ./te-monitor-macos.sh -k "YOUR_API_KEY" > /dev/null 2>&1 &
Background Execution: This command runs the script silently in the background. Replace 'YOUR_API_KEY' with your actual API key.
Important: The script will continue running even after you log out. To stop it, you'll need to find and kill the process.
7
Create Launch Agent (Optional)
For automatic startup, create a Launch Agent that runs the script on boot.
Create the plist file:
nano ~/Library/LaunchAgents/com.temonitor.agent.plist
Add the following content:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.temonitor.agent</string>
<key>ProgramArguments</key>
<array>
<string>/Users/YOUR_USERNAME/te-monitor-macos.sh</string>
<string>-k</string>
<string>YOUR_API_KEY</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
Load the Launch Agent:
launchctl load ~/Library/LaunchAgents/com.temonitor.agent.plist
8
Verify Monitoring
Check that your Mac appears online in the NetSentryAlert dashboard.
Verification: Go to the Servers page and verify that your Mac shows as "online" with real-time metrics in TE Monitor dashboard.
Troubleshooting
If you get "Permission denied" error:
chmod +x te-monitor-macos.sh
Install required packages:
brew install curl bc
If macOS blocks the script execution:
xattr -d com.apple.quarantine te-monitor-macos.sh
Script Options
Command Line Options:
-k, --api-key- API Key (required)-s, --server-url- Server URL (optional)-i, --interval- Update interval in seconds (optional)-h, --help- Show help message
Example Usage:
./te-monitor-macos.sh -k "abc123" -s "https://monitor.te.com.tr" -i 10
Security Notes
Important:
- Keep your API key secure and private
- Use HTTPS for secure communication
- Monitor script logs for any issues
- Regularly update the monitoring script
- Consider using Launch Agents for production