Recent Posts

Archives

Topics


« | Main | »

Using the ReadyNAS to create a Network UPS for PCs

By dbott | October 8, 2010

The ReadyNAS can issue “UPS commands” to other devices, effectively allowing your UPS to be networked and shutdown client PCs. I’ve got my UPS connected to the NAS and setup using the procedure below.

Basically, you need to install WinNUT on your PC.  Instructions for OSX and Linux can be found below.

You also need to configure your ReadyNAS to communicate with the PC:

  1. Connect the UPS to the NAS via USB.
  2. Login to Frontview on your NAS.
  3. Click SYSTEM –> POWER.
  4. Scroll down to the UPS section.
  5. Check the box that says “Enable network sharing of attached UPS
  6. Enter the IP address of the PC or the subnet (i.e. 192.168.1.0/24).

7. Edit the WinNUT configuration file (typically C:\Program Files\WinNUT\upsmon.conf). In my case, my ReadyNAS uses a static IP (192.168.1.2) and my computers use DHCP on the 192.168.1.0/24 subnet). I’ve edited out most author comments, just leaving the values I used:

#  --------------------------------------------------------------------------
#  MONITOR <system> <powervalue> <username>  <password> ("master"|"slave")

MONITOR UPS@192.168.1.2 1  monuser pass slave

#  --------------------------------------------------------------------------
#  MINSUPPLIES <num>

MINSUPPLIES 1

#  --------------------------------------------------------------------------
#  NOTIFYCMD <command>

NOTIFYCMD "c:\\Program  Files\\WinNUT\\alertPopup.exe"

#  --------------------------------------------------------------------------
#  POLLFREQ <n> 

POLLFREQ 5

#  --------------------------------------------------------------------------
#  POLLFREQALERT <n>

POLLFREQALERT 5

#  --------------------------------------------------------------------------
#  HOSTSYNC - How long upsmon will wait before giving up on another upsmon

HOSTSYNC  15

#  --------------------------------------------------------------------------
#  DEADTIME - Interval to wait before declaring a stale ups "dead"

DEADTIME  15

#  --------------------------------------------------------------------------
#  NOTIFYMSG - change messages sent by upsmon when certain events occur

NOTIFYMSG  ONLINE "UPS %s is getting line power"
NOTIFYMSG ONBATT "Someone  pulled the plug on %s"
NOTIFYMSG LOWBATT "UPS has a low battery"
NOTIFYMSG  SHUTDOWN "The system is being shutdown"

#  --------------------------------------------------------------------------
#  NOTIFYFLAG - change behavior of upsmon when NOTIFY events occur

NOTIFYFLAG  ONLINE EXEC
NOTIFYFLAG ONBATT EXEC
NOTIFYFLAG LOWBATT EXEC
NOTIFYFLAG  SHUTDOWN EXEC

#  --------------------------------------------------------------------------
#  RBWARNTIME - replace battery warning time in seconds

RBWARNTIME  43200

#  --------------------------------------------------------------------------
#  NOCOMMWARNTIME - no communications warning time in seconds

NOCOMMWARNTIME  300

#  --------------------------------------------------------------------------
#  FINALDELAY - last sleep interval before shutting down the system

FINALDELAY  5

Here’s a couple of screenshots from my PC when the UPS gets disconnected:

Mac Users

Update 2: See Infinite’s post here for OSX users: http://www.readynas.com/forum/viewtopic.php?f=28&t=35314&p=196117#p195952

Update 1: See Egg’s post here for OSX users: http://www.readynas.com/forum/viewtopic.php?f=28&t=29452&p=166024#p166024

It looks like there’s an OSX port of NUT:

http://boxster.ghz.cc/projects/nut/wiki/NutOnMacOSX

I took a quick read of the HOWTO above.  The HOWTO explains how to setup a MASTER on OSX (which is the device that the UPS is directly connected to), as well as CLIENT machines to monitor the UPS.

For OSX users, the NAS is the MASTER and you’ll just need to configure NUT as a client that points to your NAS.

Then configure the conf file to suit your network.

Linux Users

Most distros should have NUT available through the package management software repositories.  The link below provides links to some related packages:

http://www.networkupstools.org/client-projects/

More Information

The original how-to is documented in the ReadyNAS forums here: http://www.readynas.com/forum/viewtopic.php?f=11&t=16744&p=89080#p89080

Read this thread for more information/background on networking a UPS device: http://www.readynas.com/forum/viewtopic.php?t=16348

Topics: ReadyNAS, Tech | No Comments »

Comments are closed.