Guide

Monitor a Mac with a user LaunchAgent

Send regular HTTPS heartbeats using curl and launchd. The installer runs in your desktop session and can be updated or removed with one command.

A heartbeat while your Mac is awake and logged in

The macOS installer creates a LaunchAgent for the current desktop user. It starts the heartbeat sender at login and keeps it running in that session. Run the installer as that user, without sudo.

Sleep, shutdown and logout stop check-ins. If those are expected in your workflow, allow an appropriate alert delay or use this check on a Mac that is intended to stay awake. The sender does not prevent sleep.

Install in your desktop session

  1. Create an account, then add a device with a name you will recognize in an alert.
  2. Choose and save the heartbeat interval and alert delay. These examples use 60 seconds between requests; match your sender to the saved settings. The alert delay must be at least twice the heartbeat interval and leave room for network delays.
  3. Open Heartbeat setup on the device. The dashboard provides commands with your URL and selected interval already filled in.

Replace YOUR_DEVICE_KEY with the value after v= in your device’s heartbeat URL, including the account and device identifiers. The TurnIt endpoint is already filled in. Keep your personal URL private.

Run as your desktop user, without sudo. The installer creates a LaunchAgent and confirms the first accepted heartbeat. Run again to update. It runs while you are logged in; the device shows offline while the Mac sleeps or is off.

Install / update
curl -fsSL 'https://www.turnit.app/install.sh?v=YOUR_DEVICE_KEY&interval=60' | sh
Uninstall
curl -fsSL 'https://www.turnit.app/install.sh?v=YOUR_DEVICE_KEY&uninstall=1' | sh

Read the installer script before running it. Stop an existing manual sender before installing; uninstall before switching installation methods.

Manual setup alternative

Save the plist under ~/Library/LaunchAgents and load it with the command below. It runs at login and every interval while you are logged in. The device shows offline while the Mac sleeps or is off.

~/Library/LaunchAgents/app.turnit.heartbeat.plist
<?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>app.turnit.heartbeat</string>
  <key>ProgramArguments</key>
  <array>
    <string>/usr/bin/curl</string>
    <string>--fail</string>
    <string>--silent</string>
    <string>--show-error</string>
    <string>--max-time</string>
    <string>5</string>
    <string>--output</string>
    <string>/dev/null</string>
    <string>https://api.turnit.app/api/send?v=YOUR_DEVICE_KEY</string>
  </array>
  <key>StartInterval</key>
  <integer>60</integer>
  <key>RunAtLoad</key>
  <true/>
</dict>
</plist>
Load
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/app.turnit.heartbeat.plist
Remove
launchctl bootout gui/$(id -u)/app.turnit.heartbeat

Keep automatic and manual setup separate

The installer manages a device-specific LaunchAgent and a repeating shell sender. The manual alternative uses a plist with StartInterval. Choose one method and stop the old sender before changing methods so they do not compete for the same heartbeat URL.

For manual setup, create ~/Library/LaunchAgents if needed, save the plist with the displayed filename and run the Load command from a terminal in your desktop session. Remove unloads that manual agent; delete its plist if you no longer want it to load on login.

What if the Mac shows Offline after waking?

Give the network and sender time to resume, then check Last heartbeat. The next accepted request restores the monitor. If no request arrives, check that the desktop session is active and that the Mac can reach the endpoint.

The automatic installer checks the initial request and handles Retry-After responses. Rerun the dashboard’s updated install command after saving a new interval. To remove the automatic installation, run its Uninstall command as the same user.

Give your device a way to check in

Create a device to get your own heartbeat URL and setup instructions.