NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
dbott67
Mar 03, 2008Guide
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...
dbott67
Sep 05, 2008Guide
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.
The username & password should be monuser & pass:
The powervalue is normally set to 1:
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.
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.
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.
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.
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":
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:
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.
Hope this helps.
-Dave
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
Related Content
NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!