Protection from power failures! Mac, UPS, NAS & NUT

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”&gt;
<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

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s