× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

Using the ReadyNAS to create a Network UPS for PCs

dbott67
Guide

Using the ReadyNAS to create a Network UPS for PCs

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.

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

1. Connect the UPS to the NAS via USB.
2. Login to the web interface of 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:






Read this thread for more information/background on networking a UPS device:

viewtopic.php?t=16348

-Dave
Message 1 of 31
dbott67
Guide

Re: Using the ReadyNAS to create a Network UPS for PCs

Mac Users:

Update: Nov. 15, 2009 - See Infinite's post here for OSX users: viewtopic.php?f=28&t=35314&p=196117#p195952

Update: June 15, 2009 - See Egg's post here for OSX users: 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/

-Dave
Message 2 of 31
jcollins
Aspirant

Re: Using the ReadyNAS to create a Network UPS for PCs

As a side note, I think this is only useful if you have the PC on the same UPS as the ReadyNAS. Otherwise the PC (which draws more power) will die before the ReadyNAS UPS's does.
Message 3 of 31
danzenie
Aspirant

Re: Using the ReadyNAS to create a Network UPS for PCs

Hello,

I don't see the option to enable network sharing of attched UPS. I am usuing Version 4.01c1-p1. Is there a step that I'm missing?
Message 4 of 31
super_poussin
Virtuoso

Re: Using the ReadyNAS to create a Network UPS for PCs

Just a little Information : it will not work with duo
Message 5 of 31
tvos
Aspirant

Re: Using the ReadyNAS to create a Network UPS for PCs

Hello Readynas Friends..:)

I tried the example above but using my own settings of course, but I received error message
Fata Error: insufficent power configured! edit your configuration and change the values.

Here is my setup that is connected to the UPS battery backup:

Readynas NV
APC UPS 550V/330W
Asus Pent IV 2.0ghz PC
Linksys VPN Wrv200 router


My nas is 10.190.39.100 and my subnet is: 255.255.254.0
UPS Name is: UPS 1

Do I need APC powerchute on the lan pc I want to shut down or will WINUT suffice?


Here is what I have created in the .cfg file:
# --------------------------------------------------------------------------
# MONITOR <system> <powervalue> <username> <password> ("master"|"slave")

MONITOR UPS 1@10.190.39.100 1 (secret username) pass (secret password)

# --------------------------------------------------------------------------
# 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
Please advise
Message 6 of 31
tvos
Aspirant

Re: Using the ReadyNAS to create a Network UPS for PCs

Friends,

I changed the vaule of UPS 1 to just UPS and it now works with no errors. I guess the only true way to test and see if it works is to pull the plug and see if NAS and the PC do indeed power down safely.

In the meantime, here is my log:

Level INFO 07/07/2008 00:10:55 Detected OS as Windows XP
Level NOTICE 07/07/2008 00:10:55 Network UPS Tools upsmon 2.0.0b
Level INFO 07/07/2008 00:10:55 UPS: UPS@10.190.39.100 (slave) (power value 1)
Level INFO 07/07/2008 00:10:55 Config Load: MINSUPPLIES set to 1
Level INFO 07/07/2008 00:10:55 Config Load: NOTIFYCMD set to c:\Program Files\WinNUT\alertPopup.exe
Level INFO 07/07/2008 00:10:55 Config Load: POLLFREQ set to 5
Level INFO 07/07/2008 00:10:55 Config Load: POLLFREQALERT set to 5
Level INFO 07/07/2008 00:10:55 Config Load: HOSTSYNC set to 15
Level INFO 07/07/2008 00:10:55 Config Load: DEADTIME set to 15
Level INFO 07/07/2008 00:10:55 Config Load: NOTIFYMSG set to ONLINE : UPS %s is getting line power
Level INFO 07/07/2008 00:10:55 Config Load: NOTIFYMSG set to ONBATT : Someone pulled the plug on %s
Level INFO 07/07/2008 00:10:55 Config Load: NOTIFYMSG set to LOWBATT : UPS has a low battery
Level INFO 07/07/2008 00:10:55 Config Load: NOTIFYMSG set to SHUTDOWN : The system is being shutdown
Level INFO 07/07/2008 00:10:55 Config Load: NOTIFYFLAG set to ONLINE : EXEC
Level INFO 07/07/2008 00:10:55 Config Load: NOTIFYFLAG set to ONBATT : EXEC
Level INFO 07/07/2008 00:10:55 Config Load: NOTIFYFLAG set to LOWBATT : EXEC
Level INFO 07/07/2008 00:10:55 Config Load: NOTIFYFLAG set to SHUTDOWN : EXEC
Level INFO 07/07/2008 00:10:55 Config Load: RBWARNTIME set to 43200
Level INFO 07/07/2008 00:10:55 Config Load: NOCOMMWARNTIME set to 300
Level INFO 07/07/2008 00:10:55 Config Load: FINALDELAY set to 5
Level ALERT 07/07/2008 00:10:55 WinNUTUpsMon Service is starting to monitor UPS


Any other sugguestions will be appreciative. Does this look right?

What is the best way to test besides waiting for power to go out..:)

Thank You,

Tvos
Message 7 of 31
agspoon
Aspirant

Re: Using the ReadyNAS to create a Network UPS for PCs

super-poussin wrote:
Just a little Information : it will not work with duo


While it is true that the Duo GUI does not have this feature, it is still possible achieve the same capability with a little more work. The work-around requires changing some configuration files for the Nut service on the Duo. To do this you will have to have installed the SSH root login add-on, and know your way around a Linux file system.

The Nut daemon and monitor configuration files are located in /etc/nut, and can be edited to enable remote monitoring by a WinNUT client (or others). Two files need to be modified (upsd.conf and upsd.users). All disclaimers apply regarding modifications to your box as root.

First copy the original files to a safe place (don't get confused with the other similarly named config files in that directory),

mynas:~# cd /etc/nut
mynas:/etc/nut# cp upsd.conf upsd.conf.original
mynas:/etc/nut# cp upsd.users upsd.users.original

Then modify upsd.conf to allow remote access to the UPS daemon. I added the two lines that contain reference to "mynet". Note, I opened it up to the entire 192.168.1.0/24 subnet. You could be more specific if you only want to allow a single PC to access it, and that PC has a static IP address (mine uses DHCP).

mynas:/etc/nut# cat upsd.conf
ACL all 0.0.0.0/0
ACL localhost 127.0.0.1/32
ACL mynet 192.168.1.0/24

ACCEPT monitor localhost
ACCEPT monitor mynet
REJECT all all

Now you have to create an authenticated user by modifying the upsd.users file to add an arbitrary user ("pcuser" in my case). The "allowfrom" directive has to match the ACL you created in upsd.conf above. Note the PC is a slave since it will take direction from the Duo that is actually connected to the UPS. Strictly speaking, you could re-use the "monuser" authentication, but I preferred to create one specifically for the PC.

mynas:/etc/nut# cat upsd.users
[monuser]
password = pass
allowfrom = localhost
upsmon master
[pcuser]
password = your_pass
allowfrom = mynet
upsmon slave

Then all you have to do is tell the upsd daemon to re-read it's configuration file (or reboot the Duo).

mynas:/etc/nut# upsd -c reload

At this point, your remote client (e.g. WinNUT) should be able to contact the Duo and read the status of the UPS. Note, you have to configure the PC client with the same user ("pcuser") and password ("your_pass") that you configured here. For the WinNUT client it would look like this (assuming your Duo is at 192.168.1.2),

MONITOR UPS@192.168.1.2 1 pcuser your_pass slave

I'm not sure why Netgear chose to leave this capability out of the Duo GUI (probably a marketing decision), but I can report that it works well for me after a little hacking.

Safe computing 🙂
Craig
Message 8 of 31
snahl
Tutor

Re: Using the ReadyNAS to create a Network UPS for PCs

Hi 'dbott67'

thanks for your instructions.
Somehow I am not getting this quite right.

I installed WinNut and configured it pretty much according to your suggestion. Though some questions remained to me.

The file: upsmon.conf
- the parameters <username> <password> mean to enter the same credentials as used in FrontView, correct?
- The parameter <powervalue> corresponds to the IP-Address of the NAS, correct?

In the WinNut ConfigTool:
-The default port-number for the Upsd is 3493. Does that remain unchanged?
-Where is it set in Windows?
-Is that port open to Firewalls within the local Network? (normally yes).
-Presumably WinNut should certainly be installed as service, correct?

In Frontview:
- The field 'Hosts allowed access' contains a sinlge client or a network IP-address, correct?
- What means the '/24' in your example? (presumably some IP-address syntax in octets)
- Setting the low threshold for shutdown to say 20% would allow enough (power)-time to properly shutdown attached PCs. What is your experience. Or is it better to set those values in upsmon.conf?

General:
How can one verify that the UPS and the Clients are communicating appart from the network activity in the systems tray? My LogFile doesn't show anything and notifications set in the upsmon.conf are not visible to me.
Apparently the UPS becomes networked by means of WinNut, but where would I assign its IP-address?

I am bit puzzled on this.

I've got the following set up:
2 Ready-NAS, a X6 and a NV+ both on release 4.00c1-p2 with IP-adr: 192.168.1.41 and 42
3 Client PC's Windows XP sp3 (192.168.1.34 , 36 , 38)
1 UPS with 1 serial and 1 USB port. But only 1 of the 2 ports can be used. If the USB-port is activated once the serial port gets deactivated automatically (and remains deactivated).

How do I get this to work properly and how can I test it without pulling the plug (though I will do so later in order to adjust the timing paramters, but only after verifying proper functionality).

Also I did read the thread 16348 about obtaining 'information/background on networking a UPS device. Sorry to say, but that did not increase my understanding.

You seem to be the person to assist in getting this going properly.
Your feedback and advice is highly appreciated.
Thank you for your attention.
Hans.
Message 9 of 31
dbott67
Guide

Re: Using the ReadyNAS to create a Network UPS for PCs

Hi Hans,

I've tried to answer your questions as best I can. I've also taken the liberty of modifying my config file that you should be able to copy & paste into each client PC. The only assumption I've made is that the IP of the NV+ is 192.168.1.42. If it's different, you'll need to modify the IP address in the config file.

snahl wrote:
The file: upsmon.conf
- the parameters <username> <password> mean to enter the same credentials as used in FrontView, correct?
- The parameter <powervalue> corresponds to the IP-Address of the NAS, correct?


The username & password should be monuser & pass:

MONITOR UPS@ip.address.of.nas 1 monuser pass slave


The powervalue is normally set to 1:
# <powervalue> is an integer - the number of power supplies that this UPS 
# feeds on this system. Most computers only have one power supply, so this
# is normally set to 1. You need a pretty big or special box to have any
# other value here.


snahl wrote:
In the WinNut ConfigTool:
-The default port-number for the Upsd is 3493. Does that remain unchanged?
-Where is it set in Windows?
-Is that port open to Firewalls within the local Network? (normally yes).
-Presumably WinNut should certainly be installed as service, correct?


Yes... just leave it at the default. Within the WinNUT program, there is an option to edit the configuration file (C:\Program Files\WinNUT\upsmon.conf). The file is well documented/commented by the programmers and provides information on how to change the port, if desired.

snahl wrote:
In Frontview:
- The field 'Hosts allowed access' contains a sinlge client or a network IP-address, correct?
- What means the '/24' in your example? (presumably some IP-address syntax in octets)


You can either enter a single IP address or the entire subnet. In my case, I wanted to allow any device on my network to access the UPS, so I specified the entire subnet (192.168.1.0/24).

Whenever you specify a network using the convention 192.168.1.0/24 it means that the first 24 bits of the address (aka the first 3 octets or 192.168.1) are the 'network' portion, and the last 8 bits (or last octet) is the host. This is typically referred to as CIDR (classless inter-domain routing). So, the using 192.168.1.0/24 basically means *any* valid IP address from 192.168.1.1 through 192.168.1.254.

snahl wrote:
Setting the low threshold for shutdown to say 20% would allow enough (power)-time to properly shutdown attached PCs. What is your experience. Or is it better to set those values in upsmon.conf?


Limited experience here. The values to shut down the PC would need to be set in C:\Program Files\WinNUT\upsmon.conf if you want it to shutdown at a specific percentage.

snahl wrote:
General:
How can one verify that the UPS and the Clients are communicating appart from the network activity in the systems tray? My LogFile doesn't show anything and notifications set in the upsmon.conf are not visible to me.
Apparently the UPS becomes networked by means of WinNut, but where would I assign its IP-address?


Well. if you follow my recommendations below, just unplugging the network cable on the NV+ should cause the X6 and each PC to start popping up messages.

snahl wrote:
I am bit puzzled on this.

I've got the following set up:
2 Ready-NAS, a X6 and a NV+ both on release 4.00c1-p2 with IP-adr: 192.168.1.41 and 42
3 Client PC's Windows XP sp3 (192.168.1.34 , 36 , 38)
1 UPS with 1 serial and 1 USB port. But only 1 of the 2 ports can be used. If the USB-port is activated once the serial port gets deactivated automatically (and remains deactivated).

How do I get this to work properly and how can I test it without pulling the plug (though I will do so later in order to adjust the timing paramters, but only after verifying proper functionality).

Also I did read the thread 16348 about obtaining 'information/background on networking a UPS device. Sorry to say, but that did not increase my understanding.

You seem to be the person to assist in getting this going properly.
Your feedback and advice is highly appreciated.
Thank you for your attention.
Hans.


My recommendations:

1. Plug the UPS into the NV+ via USB.

2. In Frontview on the NV+, go to SYSTEM > POWER and enable network sharing.

3. Enter the following in the "Hosts allowed access":
192.168.1.0/24


4. On the X6, open Frontview and go to SYSTEM > POWER and in the Enable monitoring of UPS physically attached to a remote ReadyNAS enter the IP address of your NV+. You should get a message that says:
Successfully connected to remote UPS


5. On each PC, copy the code below into the configuration file. I've modified my configuration file to reflect that the NAS is located at 192.168.1.42.

# Network UPS Tools: example upsmon configuration
#
# This file contains passwords, so keep it secure.

############################################################################
# WinNUT Users
#===============
# I've tried to remove most of the configuration options that don't apply
# when running under windows. Other than those options, the file is the
# same as unix file. And if you have the extra options in this file, it
# shouldn't really cause any problems
#
#

# --------------------------------------------------------------------------
# MONITOR <system> <powervalue> <username> <password> ("master"|"slave")
#
# List systems you want to monitor. Not all of these may supply power
# to the system running upsmon, but if you want to watch it, it has to
# be in this section.
#
# You must have at least one of these declared.
#
# <system> is a UPS identifier in the form <upsname>@<hostname>[:<port>]
# like localhost, su700@mybox, etc.
#
# Examples:
#
# - "su700@mybox" means a UPS called "su700" on a system called "mybox"
#
# - "fenton@bigbox:5678" is a UPS called "fenton" on a system called
# "bigbox" which runs upsd on port "5678".
#
# The UPS names like "su700" and "fenton" are set in your ups.conf
# in [brackets] which identify a section for a particular driver.
#
# If the ups.conf on host "doghouse" has a section called "snoopy", the
# identifier for it would be "snoopy@doghouse".
#
# <powervalue> is an integer - the number of power supplies that this UPS
# feeds on this system. Most computers only have one power supply, so this
# is normally set to 1. You need a pretty big or special box to have any
# other value here.
#
# You can also set this to 0 for a system that doesn't supply any power,
# but you still want to monitor. Use this when you want to hear about
# changes for a given UPS without shutting down when it goes critical,
# unless <powervalue> is 0.
#
# <username> and <password> must match an entry in that system's
# upsd.users. If your username is "monmaster" and your password is
# "blah", the upsd.users would look like this:
#
# [monmaster]
# password = blah
# allowfrom = (whatever applies to this host)
# upsmon master (or slave)
#
# "master" means this system will shutdown last, allowing the slaves
# time to shutdown first.
#
# "slave" means this system shuts down immediately when power goes critical.
# WinNUT users: WinNUT should always be a slave since we're not the machine
# talking directly to the ups
#
# Examples:
#
# MONITOR myups@bigserver 1 monmaster blah master
# MONITOR su700@server.example.com 1 upsmon secretpass slave

MONITOR UPS@192.168.1.42 1 monuser pass slave

# --------------------------------------------------------------------------
# MINSUPPLIES <num>
#
# Give the number of power supplies that must be receiving power to keep
# this system running. Most systems have one power supply, so you would
# put "1" in this field.
#
# Large/expensive server type systems usually have more, and can run with
# a few missing. The HP NetServer LH4 can run with 2 out of 4, for example,
# so you'd set that to 2. The idea is to keep the box running as long
# as possible, right?
#
# Obviously you have to put the redundant supplies on different UPS circuits
# for this to make sense! See big-servers.txt in the docs subdirectory
# for more information and ideas on how to use this feature.

MINSUPPLIES 1

# --------------------------------------------------------------------------
# NOTIFYCMD <command>
#
# upsmon calls this to send messages when things happen
#
# This command is called with the full text of the message as one argument.
# The environment string NOTIFYTYPE will contain the type string of
# whatever caused this event to happen.
#
# Note that this is only called for NOTIFY events that have EXEC set with
# NOTIFYFLAG. See NOTIFYFLAG below for more details.
#
# Making this some sort of shell script might not be a bad idea. For more
# information and ideas, see pager.txt in the docs directory.
#
# Example:
# NOTIFYCMD /usr/local/ups/bin/notifyme
# WinNUT users: use the alertPopup.exe found in WinNUT binary distribution
# IMPORTANT NOTE!!!! Backslashes are now escape characters, you must
# now use \\ in the path to get a backslash char.
# Windows Example:
NOTIFYCMD "c:\\Program Files\\WinNUT\\alertPopup.exe"

# --------------------------------------------------------------------------
# POLLFREQ <n>
#
# Polling frequency for normal activities, measured in seconds.
#
# Adjust this to keep upsmon from flooding your network, but don't make
# it too high or it may miss certain short-lived power events.

POLLFREQ 5

# --------------------------------------------------------------------------
# POLLFREQALERT <n>
#
# Polling frequency in seconds while UPS on battery.
#
# You can make this number lower than POLLFREQ, which will make updates
# faster when any UPS is running on battery. This is a good way to tune
# network load if you have a lot of these things running.
#
# The default is 5 seconds for both this and POLLFREQ.

POLLFREQALERT 5

# --------------------------------------------------------------------------
# HOSTSYNC - How long upsmon will wait before giving up on another upsmon
#
# The master upsmon process uses this number when waiting for slaves to
# disconnect once it has set the forced shutdown (FSD) flag. If they
# don't disconnect after this many seconds, it goes on without them.
#
# Similarly, upsmon slave processes wait up to this interval for the
# master upsmon to set FSD when a UPS they are monitoring goes critical -
# that is, on battery and low battery. If the master doesn't do its job,
# the slaves will shut down anyway to avoid damage to the file systems.
#
# This "wait for FSD" is done to avoid races where the status changes
# to critical and back between polls by the master.

HOSTSYNC 15

# --------------------------------------------------------------------------
# DEADTIME - Interval to wait before declaring a stale ups "dead"
#
# upsmon requires a UPS to provide status information every few seconds
# (see POLLFREQ and POLLFREQALERT) to keep things updated. If the status
# fetch fails, the UPS is marked stale. If it stays stale for more than
# DEADTIME seconds, the UPS is marked dead.
#
# A dead UPS that was last known to be on battery is assumed to have gone
# to a low battery condition. This may force a shutdown if it is providing
# a critical amount of power to your system.
#
# Note: DEADTIME should be a multiple of POLLFREQ and POLLFREQALERT.
# Otherwise you'll have "dead" UPSes simply because upsmon isn't polling
# them quickly enough. Rule of thumb: take the larger of the two
# POLLFREQ values, and multiply by 3.

DEADTIME 15

# --------------------------------------------------------------------------
# NOTIFYMSG - change messages sent by upsmon when certain events occur
#
# You can change the stock messages to something else if you like.
#
# NOTIFYMSG <notify type> "message"
#
# NOTIFYMSG ONLINE "UPS %s is getting line power"
# NOTIFYMSG ONBATT "Someone pulled the plug on %s"
#
# Note that %s is replaced with the identifier of the UPS in question.
#
# Possible values for <notify type>:
#
# ONLINE : UPS is back online
# ONBATT : UPS is on battery
# LOWBATT : UPS has a low battery (if also on battery, it's "critical")
# FSD : UPS is being shutdown by the master (FSD = "Forced Shutdown")
# COMMOK : Communications established with the UPS
# COMMBAD : Communications lost to the UPS
# SHUTDOWN : The system is being shutdown
# REPLBATT : The UPS battery is bad and needs to be replaced
# NOCOMM : A UPS is unavailable (can't be contacted for monitoring)

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
#
# By default, upsmon sends walls (global messages to all logged in users)
# and writes to the syslog when things happen. You can change this.
#
# NOTIFYFLAG <notify type> <flag>[+<flag>][+<flag>] ...
#
# NOTIFYFLAG ONLINE SYSLOG
# NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC
#
# Possible values for the flags:
#
# SYSLOG - Write the message in the syslog
# WALL - Write the message to all users on the system
# EXEC - Execute NOTIFYCMD (see above) with the message
# IGNORE - Don't do anything
#
# If you use IGNORE, don't use any other flags on the same line.

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

# --------------------------------------------------------------------------
# RBWARNTIME - replace battery warning time in seconds
#
# upsmon will normally warn you about a battery that needs to be replaced
# every 43200 seconds, which is 12 hours. It does this by triggering a
# NOTIFY_REPLBATT which is then handled by the usual notify structure
# you've defined above.
#
# If this number is not to your liking, override it here.

RBWARNTIME 43200

# --------------------------------------------------------------------------
# NOCOMMWARNTIME - no communications warning time in seconds
#
# upsmon will let you know through the usual notify system if it can't
# talk to any of the UPS entries that are defined in this file. It will
# trigger a NOTIFY_NOCOMM by default every 300 seconds unless you
# change the interval with this directive.

NOCOMMWARNTIME 300

# --------------------------------------------------------------------------
# FINALDELAY - last sleep interval before shutting down the system
#
# On a master, upsmon will wait this long after sending the NOTIFY_SHUTDOWN
# before executing your SHUTDOWNCMD. If you need to do something in between
# those events, increase this number. Remember, at this point your UPS is
# almost depleted, so don't make this too high.
#
# Alternatively, you can set this very low so you don't wait around when
# it's time to shut down. Some UPSes don't give much warning for low
# battery and will require a value of 0 here for a safe shutdown.
#
# Note: If FINALDELAY on the slave is greater than HOSTSYNC on the master,
# the master will give up waiting for the slave to disconnect.
#
### WinNUT users - this was previously the ALERTTIME variable
#

FINALDELAY 5


Hope this helps.

-Dave
Message 10 of 31
tvos
Aspirant

Re: Using the ReadyNAS to create a Network UPS for PCs

thanx dude... the nas has been on ups power using winnut for the last couple months successful! - works beautifully...

just need to know how and why i am getting duplicate backkup job logs.

tvos
Message 11 of 31
markg1
Aspirant

Re: Using the ReadyNAS to create a Network UPS for PCs

i followed the string above and got it to work!! thanks everyone for the tips.

two questions;

1 the NOTIFYFLAG values; do i need that? im not clear on what that does for me. at this point i dont have any value specified, like the default file.

2 in frontview, on the ups button, it shows i have 9 minutes of standby time on my ups. but....when i used the apc software, it said i had 25 minutes, which is more or less correct. i know this has nothing to do with winnut, but this is the first time i connected the ups to the readynas (figuring it better to protect the open files on the pc and use full journaling on the nas box). is the readynas just reading this incorrectly, or is that what it figures it will run before shutdown?

thanks,

mark
Message 12 of 31
essd
Aspirant

Network UPS monitor for ReadyNAS Duo

super-poussin wrote:
Just a little Information : it will not work with duo


Even though the UPS network monitor user interface element is disabled in FrontView for the Duo (I guess it's not part of Netgear's SOHO feature matrix?), so long as you have the root SSH add-in installed, it's actually very easy to enable UPS network monitoring for the Duo yourself:

1. Edit /etc/nut/upsd.conf to add the following line:

ACL localnet 192.168.0.1/24

...assuming that you want to permit UPS monitoring access to anyone on the 192.168.0.xxx subnet. If you are on a different network, modify the address and CIDR notation appropriately.

2. In the same file, edit the line that reads "ACCEPT monitor localhost readynas" and add the word "localnet" to the end, such that you have:

ACCEPT monitor localhost readynas localnet

3. Edit the file /etc/nut/upsd.users. Adjust the "allowfrom" line to read as follows:

allowfrom = localhost localnet

4. Tell the UPS daemon to reload its configuration files with "/sbin/upsd -c reload".

From there, it should be working! You can then install NUT on another system and monitor the UPS connected to your ReadyNAS. The following line in my client system's upsmon.conf worked very well:

MONITOR UPS@<insert_your_NAS_ip_here> 1 monuser pass slave
Message 13 of 31
THN
Aspirant
Aspirant

Re: Using the ReadyNAS to create a Network UPS for PCs

Dave, thanks for the great instructions, but I am a little hesitant to go down that road, because super-poussin said:
super-poussin wrote:
Just a little Information : it will not work with duo
So I was wondering if the SNMP for The DUO V 1.0 addon will enable me to do your procedure with your instructions on my XP and Vista machines.
Message 14 of 31
essd
Aspirant

Re: Using the ReadyNAS to create a Network UPS for PCs

THN wrote:
Dave, thanks for the great instructions, but I am a little hesitant to go down that road, because super-poussin said:
super-poussin wrote:
Just a little Information : it will not work with duo


When super-poussin wrote that, I believe he was referring only to the built-in FrontView user interface for enabling UPS sharing (which is present in only the NV+ models). It's true that the Duo does not have this option exposed in the UI, but my instructions (two posts up) should have exactly the same effect as that UI setting.

You don't need to install the SNMP add-on to do this. I have a Duo myself and I can confirm that the UPS sharing is working using the instructions above without any extra add-ons. (SNMP might allow you to monitor other things on the device, but it's not needed in this particular instance.)

If you're nervous, you can always make a backup copy of those config files so that you can revert in the case of trouble (which I'd recommend as a good general practice anyway).
Message 15 of 31
THN
Aspirant
Aspirant

Re: Using the ReadyNAS to create a Network UPS for PCs

Thanks for the reply essd. I had read your instructions, which are very clear and concise. However, I wanted to kind of stay away from installing the root access. Hence my question regarding the SNMP. If installing that, will allow me to monitor my NAS from a PC, that's really all I need.

When you say:
but it's not needed in this particular instance.)
does that mean that it'll allow me to monitor my NAS UPS signals from a networked PC?
Message 16 of 31
super_poussin
Virtuoso

Re: Using the ReadyNAS to create a Network UPS for PCs

essd wrote:
THN wrote:
Dave, thanks for the great instructions, but I am a little hesitant to go down that road, because super-poussin said:
super-poussin wrote:
Just a little Information : it will not work with duo


When super-poussin wrote that, I believe he was referring only to the built-in FrontView user interface for enabling UPS sharing (which is present in only the NV+ models). It's true that the Duo does not have this option exposed in the UI, but my instructions (two posts up) should have exactly the same effect as that UI setting.

You don't need to install the SNMP add-on to do this. I have a Duo myself and I can confirm that the UPS sharing is working using the instructions above without any extra add-ons. (SNMP might allow you to monitor other things on the device, but it's not needed in this particular instance.)

If you're nervous, you can always make a backup copy of those config files so that you can revert in the case of trouble (which I'd recommend as a good general practice anyway).


I think you can now with Raidiator 4.1.5
Message 17 of 31
nightstrm
Aspirant

Re: Using the ReadyNAS to create a Network UPS for PCs

Anyone here have any tips for building upsmon on OSX 10.5? I'd rather build from scratch than use fink to install.
Message 18 of 31
dbott67
Guide

Re: Using the ReadyNAS to create a Network UPS for PCs

Updated my original post to reflect Egg's work:

viewtopic.php?f=28&t=29452&p=166024#p166024
Message 19 of 31
dbott67
Guide

Re: Using the ReadyNAS to create a Network UPS for PCs

Updated my original post here to reflect Infinite's work:

viewtopic.php?f=28&t=35314&p=196117#p195952
Message 20 of 31
FarmerTed
Aspirant

Re: Using the ReadyNAS to create a Network UPS for PCs

Sorry to bring up an old thread, but it seems the WinNUT installers for Windows don't work for Win7 64-bit. Is there another method to network UPSes so that the ReadyNAS and Win7 machines can talk? I don't see an "apcupsd" package for ReadyNAS, unfortunately. This would be a great add-on since it's actively maintained for all OSes, including Windows.

Does anyone know of a client for Win7 64-bit that can talk to NUT running on the ReadyNAS?
Message 21 of 31
erincal
Aspirant

Re: Using the ReadyNAS to create a Network UPS for PCs

dbott67
That post has very good info. I have a question for you.When you edit your configuration file,in the very first entry is the user and password the ones you use to access your ready nas?
Also when click on apply on start Win nut I get a box that states insufficient power configured.Edit your configuration and change the values.This may be that my battery is low on the ups maybe not.Does it work for the Ready Nas Duo.Someone posted it does not.
Message 22 of 31
xtrips1
Aspirant

Re: Using the ReadyNAS to create a Network UPS for PCs

Hello,

I read this interesting thread but was unable to understand where my case does fit.
I have an APC UPS connected to my Readynas Pro via USB and all is working fine.
But now I am bringing in an additional Unraid NAS that will be connected to the same UPS.
I would like to know how I can make the Readynas send a shutdown command to the Unraid server over the network every time the Readynas itself decides to shutdown following a long power drop?

Thank you
Message 23 of 31
dbott67
Guide

Re: Using the ReadyNAS to create a Network UPS for PCs

xtrips wrote:
I would like to know how I can make the Readynas send a shutdown command to the Unraid server over the network every time the Readynas itself decides to shutdown following a long power drop?


I'm not familiar with Unraid, but if you can install "nut" on it you should be able to have it connect to the ReadyNAS over the network (and therefore respond to UPS events). Assuming it supports NUT, you need to do a few things:

1. Plug the UPS into the Pro via USB.

2. In Frontview on the Pro, go to SYSTEM > POWER and enable network sharing.

3. Enter your network subnet in the "Hosts allowed access". For example, if the ReadyNAS and unRAID were on the 192.168.1.xxx subnet, you would enter the following:
192.168.1.0/24


4. Modify the nut config file on the unRAID box to point to the ReadyNAS.

MONITOR UPS@ip.address.of.nas 1 monuser pass slave


That's about it. From the ReadyNAS stand-point, it's pretty straight-forward. Getting "nut" to run on unRAID may be a challenge, but I'm assuming that it's using some variant of Linux so it should be doable.

-Dave
Message 24 of 31
Deepdiver1
Aspirant

Re: Using the ReadyNAS to create a Network UPS for PCs

I wonder if anyone can help me

ReadyNas Duo, Win 7 Pro 64Bit, APC CS650 UPS

I have the nas connected to the ups and everything works fine. I also want to shut down the PC as well as the NAS. I have read about the NUT tools and installed the windows installer version. I am now completley lost as how to set it up, if it can be done. I feel if I am banging my head against a brick wall, LOL. I am pretty well pc literate. Thanks
Message 25 of 31
Top Contributors
Discussion stats
Announcements