If you watched my YouTube video on protection from power failures (here), you know I promised to include the configuration files and commands on this blog. So here they are:
To hide the ‘ups’ user:
sudo dscl . create /Users/ups IsHidden 1
In the upsmon.conf file, enter the following lines:
RUN_AS_USER ups
in the RUN_AS_USER <userid> section, and
MONITOR qnapups@192.168.1.20 1 upsmon 123456 slave
in the MONITOR <system> <powervalue> <username> <password> (“master”|”slave”) section. I didn’t change anything else from the sample file provided with the software.
My org.networkupstools.nut.plist file looks like this:
<?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>/usr/local/ups/sbin/upsmon</string>
<string>-D</string>
</array>
</dict>
</plist>
and it is located in the /Library/LaunchDaemons directory.
The command to load the daemon automatically on startup is:
sudo launchctl load /Library/LaunchDaemons/org.networkupstools.nut.plist
Hope you enjoyed the video tutorial and I hope it’s useful to you!
Michael
Hi, I got a “/Library/LaunchDaemons/org.networkupstools.nut.plist: Invalid property list” message running the final Teminal command
Additionally, I do not know, where can I see on the Mac the working connection to the UPS of the NAS. I have a Synology NAS, not a QNAP, but I think it does not matter.
LikeLike
I’m going to look into it and get back to you.
LikeLike
Hi, in the final step I have the same error as Zsolt, so I get the error “/Library/LaunchDaemons/org.networkupstools.nut.plist: Invalid property list”
Any ideas?
LikeLike
I put this in the plist. So I already corrected the mistake “>”
Label
org.networkupstools.upsmon
OnDemand
ProgramArguments
/usr/local/ups/sbin/upsmon
-D
LikeLike
Michael,
Like others I am getting “Invalid property list” even though I have double triple checked the plist. Any suggestions or ideas will really help.
LikeLike
Let me look into it. I’ve been away from this for a little while.
LikeLiked by 1 person
Hi Michael, do you already have any solution or idea for the invalid property list error. Would be awesome.
Thanks a lot and best regards,
Leon
LikeLike
Leon,
I believe you are facing the same issue as I did. Here is what worked for me and hope helps you out as well:
1. Use ‘nano’ type of editing software for all your files like the plist, upamon.conf, etc. My issue with “Invalid property list” was resolved because I recreated the plist file using nano.
2. To avoid the issue with libraries I used “sw” as the directory where the software is installed as suggested by Michael.
Stay healthy and take care,
LikeLike
As for monitoring the connection, run the daemon program in a terminal. You should get messages in the terminal when an event occurs.
LikeLiked by 1 person
I noticed that my file has a small error in it. The second line should have a > symbol instead of >. I hope that helps. The end of the line should read:
“http://www.apple.com/DTDs/PropertyList-1.0.dtd”>
LikeLike
you need corrections for mismatching quotes (e.g. ”1.0″) and replace ‘>’ with ‘>’.
LikeLike
Trying to launch the monitor in Terminal …
$ /usr/local/ups/sbin/upsmon
dyld: Library not loaded: /sw/lib/libupsclient.4.dylib
Referenced from: /usr/local/ups/sbin/upsmon
Reason: image not found
The library is in /usr/local/ups/lib/libupsclient.4.dylib
LikeLike
I fixed it by instead of manually insyalling th software I installed it thru Homebrew and ajusted the path in the launch daemon. Wonderful , all is good. Could not have done it without your previous work. Thanks a lot.
LikeLike
I’m really glad that I could help you. Isn’t it great to know that our hardware is secure from power failures? Cheers!
LikeLike
Hi Michael,
I am so glad to have found your article here. Seems that getting a UPS client installed on OSX is not quite so trivial as “run an app and configure”. I am also a QNAP user.
Question: Should the “ups” user created, be standard or administrator level and what about password, should there be one ?
thanks in advance.
LikeLike
I created a simple user, not admin, and then made it hidden. If I remember correctly, there’s no special password required. Happy the article helped you! Cheers.
LikeLike
Michael,
Appreciate your prompt response. My issue got fixed. Here is what I suggest to others reading this:
1. Use ‘nano’ type of editing software for all your files like the plist, upamon.conf, etc. My issue with “Invalid property list” was resolved because I recreated the plist file using nano.
2. To avoid the issue with libraries I used “sw” as the directory where the software is installed as suggested by Michael.
Stay healthy and take care,
LikeLike
Hello Michael,
thank you for this tutorial. I followed it but I have an issue: when I launch the daemon (sudo launchctl…), Terminal asks me for a password (normal? I write mine, I have an administrator account), but I get an error: “/Library/LaunchDaemons/org.networkupstools.nut.plist: Path had bad ownership/permissions”
Did I something wrong? What should I do now?
Best
LikeLike
Security in MacOS (Catalina) may have changed since I put up the tutorial. I’d check the file permissions in a terminal window by typing ls -al. You can then use chmod to change the permissions. I’m not a Unix expert, you might want to look that up. Good luck!
LikeLike
I really appreciate the info but there seems to be a lot of unanswered questions. In particular, where did the upsmon.conf file come from and where did you put it after you edited it? The one you edited was on your desktop. Also, you had us initially download four files, but we only used one. What do we do with the files for the libraries and USB drivers?
Thank you!
LikeLike
I put that together a long time ago. I’ll have to look at it again since I got a new computer. I may update the article.
LikeLike
Would be awesome. Haven’t found anything else yet.
Please update the article. :))
LikeLike
Would be awesome. Please update the article! 🙂
LikeLike