Setup: ReadyNAS NV+ 4.1.4 and MacMini OS X (10.5.7) on the same UPS (APC Back-UPS RS 800)
ReadyNAS NV+ 4.1.4 acts as the NUT server, connected via USB to the UPS, MacMini as a NUT client.
NOTE: ACPUSPd (
http://www.apcupsd.com) can
not communicate with NUT!
(Yes its somewhere mentioned in one of the posts in another forum, just to avoid trotting down this wrong path, cost me half a day to figure that one out...)
In order to get NUT on the MacMini installed, download Fink (
http://www.finkproject.org) and use the Fink Commander to install the
BINARY of NUT.
http://boxster.ghz.cc/projects/nut/wiki/NutOnMacOSX describes to download the source code, its not necessary anymore there is a binary now available.
In order to run only the NUT client (which is what I wanted) one needs to create the upsmon.config file in the /sw/etc/nut directory.
Open Terminal:
- Code: Select all
cd /sw/etc/nut
sudo vi upsmon.conf.sample
Change the values according to dbott67s advice for WinNut and quit vi by writing first the changed content to the new file 'upsmon.conf'.
http://www.readynas.com/forum/viewtopic.php?f=11&t=16744&p=89080&hilit=Winnut+configuration#p89080- Code: Select all
:w upsmon.conf
:q!
In order to test that the NUT client actually works, use Terminal again and start upsmon manually:
- Code: Select all
sudo upsmon
The following is slightly altered advise based on
http://boxster.ghz.cc/projects/nut/wiki/NutOnMacOSX.
Now you should be able to see two upsmon processes in the Activity Monitor one running as root, the other as nobody.
In Terminal enter the following to test the connection from your Mac via your ReadyNAS to the UPS:
- Code: Select all
sudo upsc UPS@Your_ReadyNAS_IP
In the Terminal window you should get a response back based on the type of your UPS device.
Automatic StartupI repeat here the advise from boxster but updated to the fact that this is for 10.5.7 and we
only need the NUT client service to run.
For OS X it is necessary to navigate to /System/Library/StartupItems. I started by copying another directory tree (I used 'NFS') as a template for 'UPS' directory. Then I changed to the 'UPS' directory and renamed the 'NFS' file to 'UPS' using the mv command. And last I edited the files in the 'UPS' directory.
These are the terminal commands:
cd /System/Library/StartupItems
sudo cp -R NFS UPS
cd UPS
ls
sudo mv NFS UPS
sudo vi UPS
Hint: If you shouldn't have NFS in your StartupItems folder use one which is there. (My apologies, I'm a noob so I write for noobs)
- Code: Select all
#!/bin/sh
##
# UPS Monitor script
# Using Network UPS Tools executables
# based on script by David Hough
# @ http://www.llondel.org/ups.shtml
# Note that fink executables cannot use Apple's rc.common routines
# and fink binaries don't keep their pid files in the standard OS X location
##
FINK_BIN=/sw/sbin
case $1 in
start )
${FINK_BIN}/upsmon
;;
stop )
${FINK_BIN}/upsmon -c stop
;;
restart )
$0 stop
$0 start
;;
esac
Just to be clear: thats the content of the file 'UPS'
within /Library/StartupItems/UPS
StartupParamerters.plist in the same location has to be changed to the following:
- Code: Select all
?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>Description</key>
<string>UPS Monitor client (NUT)</string>
<key>Messages</key>
<dict>
<key>start</key>
<string>Starting UPS Monitor client (NUT)</string>
<key>stop</key>
<string>Stopping UPS Monitor client (NUT)</string>
</dict>
<key>OrderPreference</key>
<string>None</string>
<key>Provides</key>
<array>
<string>UPS</string>
</array>
<key>Requires</key>
<array>
<string>Resolver</string>
</array>
</dict>
</plist>
That's it! Now the automatic start-up should work.
Last but not least don't forget to follow the advise from boxster to secure NUT ...