I came across this question while trying to remember how I did it myself, but I think I re-found the solution. I followed the directions in this mailing list post; it is a few years old but it is still working for me in macOS Sierra.
If that post becomes unavailable, here's a copy of the key info in it. Basically, once you have your upsmon configuration set up the way you want it, you just have to create a .plist file (simply a text file with the .plist extension) and put it in the right directory, then restart. I used the verbatim text from the post for the .plist file and it is still going strong for me.
Specifically, you can create a .plist file with the following contents:
<?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>org.networkupstools.upsmon</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/opt/local/sbin/upsmon</string>
<string>-D</string>
</array>
</dict>
</plist>
Then save it with a name like org.networkupstools.upsmon.plist in /Library/LaunchDaemons and it should start the service automatically on boot from that point onward.
So it seems I was missing the point of fink a bit.
had to do:
sudo apt-get update
fink install nut
Updating the package lists with apt-get update also fixed finkcommander.
After installing nut (5mins) Setting up the config in /sw/etc/nut/ as found on the net uncommenting a line:
MONITOR ups@<ip of synology> 1 monuser secret slave
After which sudo upsmon still gave an error of a missing library. Error:
dyld: Library not loaded /sw/lib/libssl.1.0.0.dylib
For this I installed openssl 1.0.2 using finkcommander (fink installed a version too high)
Then running sudo upsmon no error was given. Following https://community.netgear.com/t5/New-to-ReadyNAS/NUT-on-OSX-10-6-Sharing-a-UPS-with-ReadyNAS-and-Computers/td-p/661293 Showing 3 processes (one grep upsmon to be ignored):
ps aux | grep upsmon
And finally showing me the info of the ups:
sudo upsc UPS@<ip of nas>
All that's left is auto starting upsmon on boot by adding the following : (credit https://superuser.com/questions/1228972/how-to-automatically-launch-nut-client-at-boot-on-macos/1358980#1358980). Edited to add "s" to LaunchDaemons.
sudo nano /Library/LaunchDaemons/org.networkupstools.upsmon.plist
and fill it with:
<?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>org.networkupstools.upsmon</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/sw/sbin/upsmon</string>
<string>-D</string>
</array>
</dict>
</plist>
This issue is that libssl.1.0.0.dylib is a dynamic library. I ran into the same issue trying to use nut on an older MacOS. MacOS has a very complex scheme for permissions and it is easy to get them fouled up without even trying. In the case of nut, upsmon is dynamically linking to the .dylib when it really should be statically linked. You can hack the fink build file for upsmon.
sudo nano /sw/fink/dists/stable/main/finkinfo/net/nut.info
Find ConfigureParams: and where you see --enable-static, append in --disable-shared then have fink rebuild nut.
As far as I know there is no way to request fink or Mac Ports to always statically link. These decisions are not made by the developers of nut and they often make very bad decisions when it comes to bloated sub-packages.
Example:
https://trac.macports.org/ticket/41789
The developers of neon decided to pull in gtk and other libraries that completely loaded up upsmon with nonsense. What they should have done was statically linked the libs and also locked down neon @0.29.6_2 before it bloated up. For a system utility, with a very special purpose, it makes zero sense to use bloated up libs just because it is the path of least resistance.
With Ubiquiti enabling a NUT server on their new UPS products I was excited to have a way to safely shutdown my hardware in the event of an outage - until I realized there are no real Mac apps that are easy to use (and free) for network UPS monitoring.
So I built NUTty - a free (forever), native Mac app that finally makes network UPS monitoring simple.
What it does:
-
Lives in your menu bar and monitors any network UPS using the NUT protocol (UniFi SmartPower, APC, CyberPower, Eaton, etc.)
-
Automatically shuts down your Mac when the battery gets critically low
-
Sends push notifications to your phone via Notify when power fails or is restored
-
Lets you create custom shutdown rules based on battery level, runtime, or UPS status
-
Supports monitoring multiple UPS devices at once
Just an Important note: If you have other UPS devices, this is specifically for network UPS devices. If your UPS plugs directly into your Mac via USB, macOS already handles it natively - you don't need this.
Built entirely in Swift/SwiftUI and free forever. Perfect for home servers, Mac minis, or any setup where you want peace of mind that your Mac won't corrupt data during a power outage.
Would love to hear feedback from anyone running network UPS setups!
https://nutty.pingie.com
I was inspired with Ubiquiti enabling a NUT server on their new UPS products I was excited to have a way to safely shutdown my hardware in the event of an outage - until I realized there are no real Mac apps that are easy to use (and free) for network UPS monitoring.
So I built NUTty - a free (forever), native Mac app that finally makes network UPS monitoring simple.
What it does:
-
Lives in your menu bar and monitors any network UPS using the NUT protocol (UniFi SmartPower, APC, CyberPower, Eaton, etc.)
-
Automatically shuts down your Mac when the battery gets critically low
-
Sends push notifications to your phone via Notify when power fails or is restored
-
Lets you create custom shutdown rules based on battery level, runtime, or UPS status
-
Supports monitoring multiple UPS devices at once
Just an Important note: If you have other UPS devices, this is specifically for network UPS devices. If your UPS plugs directly into your Mac via USB, macOS already handles it natively - you don't need this.
Built entirely in Swift/SwiftUI and free forever. Perfect for home servers, Mac minis, or any setup where you want peace of mind that your Mac won't corrupt data during a power outage.
Would love to hear feedback from anyone running network UPS setups! I attempted a cross post but this was not supported in this subreddit.
https://nutty.pingie.com
I have a APC Back-UPS ES 650G2. I have these connected to it:
- RPI4 running Home Assistant (there's a NUT server addon)
- Synology DS216j (that has a builtin NUT server)
- Mac running Big Sur (has builtin UPS support but not via network)
Right now the USB cable from the UPS is connected to the Mac.
Problem: I want to safely shut down the PC AND the Syno NAS. I figured the best way would be to plug the UPS USB cable to the Syno and let that act as a NUT server. BUT every solution for the Mac to act as a client is like 6 years old, ending with High Sierra at best. I have asked around at NUT tools Github, got no answer.
Question: has anyone successfully configured and is running a Mac with Big Sur to act as a NUT tools (or APCUPSD but that seems completely abandoned) client?
Thanks!