8

Short Version: How do I get 2 computers to shutdown when a UPS battery gets low?

Long Version:

I have an APC UPS, the RS 1500. It has a USB cord that goes into my main dev computer. My dev computer will shutdown when the battery gets low.

However, in addition, I have now hooked up a database server to the same UPS.

How can I have that database server also know that it needs to shut down when the battery gets low?

Brian Webster
  • 1,123
  • 1
  • 18
  • 39

5 Answers5

13

As Chopper3 writes, more expensive UPS' can have an option to attach networked shutdown software (for an additional cost).

For a free-of-charge implementation of networked power management you want APC UPS Daemon, apcupsd. Basically you install a manager instance of apcupsd on the PC that has the USB signalling cable attached, and install apcupsd clients on other PCs attached to the UPS power. The apcupsd instances use the LAN to communicate.

Apcupsd comes in both Unix and Windows versions, and the Windows versions have existed for quite some time, so I'd expect them to be stable enough. I don't know how easy it is to set up and configure on Windows. Take a look at it, and if you don't like it, there is always the option to buy a more capable UPS...

Remember, with networked UPS management the network switch needs to be on UPS power for the management software to work when power is out... :-)

  • I just set up apcupsd on a single WIndows server with a serial connection, so I can't comment on the network connection. It may work under Windows, but make no mistake, it's a Unix program at heart. Once you get used to treating it as a unix program and have spent some time with the extensive documentation, it seems pretty easy to deal with – gillonba Jul 29 '10 at 13:19
6

Windows typically has good APC support built in, so you don't have to use PowerChute (at least starting with XP SP2 and SP3). If Windows is detecting your UPS under Control Panel -> Power Options (in XP), then look for an Alarms tab. If you can find this, you can figure an Alarm Action to run a program. In this case you might run PsShutdown from the sysinternals package to shutdown the remote machine when the battery level is at warning or critical.

I'm sorry, but I'm not at an XP machine with an APC UPS hooked up at the moment, so I'm not sure if these options will appear or not. I typically don't install the PowerChute software from APC on my XP (and above) clients because there's native support in Windows. (This is also why I standardized on APC)

Boden
  • 4,968
  • 12
  • 49
  • 70
  • I do a very similar thing with a couple of Linux servers at work that share a UPS. One of them is running apcupsd, and when the power gets low (5 mins), it runs a bash script that connects to the other with SSH (using ssh keys), and shuts it down. – Dentrasi Jan 30 '10 at 20:56
  • Windows 2008 R2 and Windows 7 do not have built in support for UPSs, you have to use the vendor supplied software again. – Chris S Apr 10 '10 at 00:53
3

In the long run, your best bet is two separate UPS's. More expensive, but it removes a single point of failure, and is less complicated than trying to coordinate a signaling system between the two machines (and it also reduces the load on each UPS).

Bart Silverstrim
  • 31,172
  • 9
  • 67
  • 87
  • I agree with what you say. However, given our budget I can either leave the DB server off a UPS altogether or I can hook into the dev machine's UPS. – Brian Webster Jan 31 '10 at 00:57
  • What is the load on these? Are they both for testing/development? If this is a small-scale thing, you could try virtualizing the database server on the dev machine and that would also minimize the impact on the power draw. Entirely depends on your system specs and workload as to how feasible this is though. – Bart Silverstrim Jan 31 '10 at 02:03
  • Well I could probably run both computers off of the RS1500 for nearly 10 minutes. We get a lot of lightning here so I'll get the benefit of no more resets from lightning. However, I don't want that DB server draining the entire battery if the power is out for say, 15 minutes. I agree with your points and appreciate the feedback. – Brian Webster Jan 31 '10 at 08:25
1

Make the dev machine tell the database machine to shutdown when it gets the battery alarm.

As to how to do that - I'm afraid that's beyond my knowledge.

Dennis Williamson
  • 62,149
  • 16
  • 116
  • 151
Douglas Leeder
  • 2,745
  • 18
  • 15
1

You can't with that model, not with the software it comes with anyway.

If you had a 'Smart-UPS' model from APC you could use their PowerChute Network Shutdown software to achieve this.

Chopper3
  • 101,299
  • 9
  • 108
  • 239