- Install Monit in /usr/local/monit:
The Monit installer package for macOS will automatically install Monit in /usr/local/monit
for you. Alternatively, you can build Monit from source:
./configure --prefix=/usr/local/monit \ --mandir=/usr/local/monit/man/ \ --sysconfdir=/usr/local/monit/conf/ make make install mkdir -p /usr/local/monit/conf/ && cp monitrc /usr/local/monit/conf/
- Edit startup configuration:
/Library/LaunchDaemons/com.tildeslash.monit.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>com.tildeslash.monit</string> <key>ProcessType</key> <string>Adaptive</string> <key>Disabled</key> <false/> <key>RunAtLoad</key> <true/> <key>LaunchOnlyOnce</key> <false/> <key>ProgramArguments</key> <array> <string>/usr/local/monit/bin/monit</string> <string>-I</string> <string>-c</string> <string>/usr/local/monit/conf/monitrc</string> </array> </dict> </plist>
- Load:
launchctl load -w /Library/LaunchDaemons/com.tildeslash.monit.plist