UPS HOWTO

EricRaymondNickChristenson

Revision History:

2.22

2007-05-22

esr

Minor update with more info about battery types.

2.1

2005-09-28

esr

Link fixes.

2.0

2005-08-15

esr

Merged in material by Nick Christenson.

1.3

2005-08-17

esr

Fix a bad link.

1.2

2004-10-28

esr

Remove a bad link.

1.1

2004-02-21

esr

Add a little deployment advice, and stuff on other technologies.

1.0

2003-10-07

esr

Initial release.

An Uninterruptible Power Supply (UPS) is an important thing to haveif you live in an area where power outages are at all common,especially if you run a mail/DNS/Web server that must be up 24/7. ThisHOWTO will teach you things you need to know to select a UPSintelligently and make it work with your open-source operating system.

Introduction

Why this document?

An Uninterruptible Power Supply (UPS) is an important thing tohave if you live in an area where power outages are at all common,especially if you run a mail/DNS/Web server that must be up 24/7. Theaging power grid in the U.S. has made this a more urgent issue than itused to be even for American hackers, but everyone is vulnerable tooutages caused by storms and other natural phenomena. This documentcovers both the software and hardware aspects of protectingyourself.An Uninterruptible Power Supply (UPS) is an important thing to have if you live in an area where power outages are at all common, especially if you run a mail/DNS/Web server that must be up 24/7. The aging power grid in the U.S. has made this a more urgent issue than it used to be even for American hackers, but everyone is vulnerable to outages caused by storms and other natural phenomena. This document covers both the software and hardware aspects of protecting yourself.The advice in this document is aimed primarily at smallinstallations — one computer and one UPS. Thus we'll focus onconsumer-grade UPSes, especially those designed for home andsmall-business use. If you are a data center administrator running abig server farm, there is a whole different (and much more expensive)range of technologies we'll do no more than hint at here.The advice in this document is aimed primarily at small installations — one computer and one UPS. Thus we'll focus on consumer-grade UPSes, especially those designed for home and small-business use. If you are a data center administrator running a big server farm, there is a whole different (and much more expensive) range of technologies we'll do no more than hint at here.The people who contribute to this document can speak only aboutequipment they have experience with. This may reflect a bias toward oragainst certain brands, features, functions, etc. Please keep in mind thatthe suggestions, brand names and functions here are by no means exhaustive,or even necessarily applicable to your situation. Also, if you haveinformation that is not in this document, please submit it to themaintainer listed above. If you submit information, please say whetheryou'd like it to be attributed to you or not. We are more than glad to givecredit to the fine people who helped with this document, but we want torespect the anonymity of those people who would prefer it.The people who contribute to this document can speak only about equipment they have experience with. This may reflect a bias toward or against certain brands, features, functions, etc. Please keep in mind that the suggestions, brand names and functions here are by no means exhaustive, or even necessarily applicable to your situation. Also, if you have information that is not in this document, please submit it to the maintainer listed above. If you submit information, please say whether you'd like it to be attributed to you or not. We are more than glad to give credit to the fine people who helped with this document, but we want to respect the anonymity of those people who would prefer it.

New versions of this document

You can also view the latest version of this HOWTO on the World Wide Webvia the URL http://www.tldp.org/HOWTO/UPS-HOWTO.html.You can also view the latest version of this HOWTO on the World Wide Web via the URL [http://www.tldp.org/HOWTO/UPS-HOWTO.html http://www.tldp.org/HOWTO/UPS-HOWTO.html]

http://www.tldp.org/HOWTO/UPS-HOWTO.html.

Copyright (c) 2003,2006 Eric S. Raymond.Copyright (c) 2003,2006 Eric S. Raymond.Permission is granted to copy, distribute and/or modify this documentunder the terms of the GNU Free Documentation License, Version 1.2or any later version published by the Free Software Foundation;with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.A copy of the license is located at www.gnu.org/copyleft/fdl.html.Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is located at [http://www.gnu.org/copyleft/fdl.html www.gnu.org/copyleft/fdl.html] www.gnu.org/copyleft/fdl.html.Feel free to mail any questions or comments about this HOWTO to EricS. Raymond, esr@snark.thyrsus.com. But please don't ask meto troubleshoot your general UPS problems; if you do, I'll justignore you.Feel free to mail any questions or comments about this HOWTO to Eric S. Raymond, Email: esr@snark.thyrsus.com. But please don't ask me to troubleshoot your general UPS problems; if you do, I'll just ignore you.

An Overview of Power Protection

Power protection guards your equipment against blackouts,brownouts, surges, and spikes. All these events are anomalies in the flow of mains power that can damage your electronic equipment.Power protection guards your equipment against blackouts, brownouts, surges, and spikes. All these events are anomalies in the flow of mains power that can damage your electronic equipment.A blackout is a complete interruption ofpower; some literature considers a voltage drop below about 80V to be ablackout as well since most equipment will not operate below thatlevel.A is a complete interruption of power; some literature considers a voltage drop below about 80V to be a blackout as well since most equipment will not operate below that level.A dropout is a very short (less than one second)blackout.A is a very short (less than one second) blackout.A brownout or sag is adecrease in voltage levels which can last for periods ranging fromfractions of a second to hours. This can be caused by heavy equipment coming online such as shop tools, elevators, compressors etc. Also occurs whenutility companies deliberately do this to cope with peak load times.A or is a decrease in voltage levels which can last for periods ranging from fractions of a second to hours. This can be caused by heavy equipment coming on line such as shop tools, elevators, compressors etc. Also occurs when utility companies deliberately do this to cope with peak load times.A spike is a tremendous increase in voltage overa very short period of time often caused by a direct lightning strike on apower line or when power returns after a blackout.A is a tremendous increase in voltage over a very short period of time often caused by a direct lightning strike on a power line or when power returns after a blackout.A surge is a substantial increase in voltagelasting a small fraction of a second, often caused when high poweredappliances such as air conditioners are switched off.A is a substantial increase in voltage lasting a small fraction of a second, often caused when high powered appliances such as air conditioners are switched off.There are three levels of power protection available to thehome computer user. The levels are:There are three levels of power protection available to the home computer user. The levels are:While this HOWTO mainly focuses on UPSs, we'll start with some basicsabout the other two kinds of power filtering to help you understand whereUPSes fit in. This is useful even though plummeting UPS prices have madethe low-end alternatives less interesting than they used to be.While this HOWTO mainly focuses on UPSs, we'll start with some basics about the other two kinds of power filtering to help you understand where UPSes fit in. This is useful even though plummeting UPS prices have made the low-end alternatives less interesting than they used to be.

Surge suppressors

These are basically a fancy fuse between the source and yourhardware; they clamp down spikes, but can't fill in a low voltagelevel or dropout.These are basically a fancy fuse between the source and your hardware; they clamp down spikes, but can't fill in a low voltage level or dropout.This is a bare minimum level of protection that any piece ofexpensive electronics should have. Note that this applies to morethan just AC power; surge suppressors are available for (and should beused on) phone lines, and RS-232 and parallel connections (for use onlong lines; generally not needed if the devices are colocated with thecomputer and all devices are protected from outside sources). Notealso that all devices connected to your computerneed to be protected; if you put a surge suppressor on your computerbut not your printer, then a zap on the printer may take out thecomputer, too.This is a bare minimum level of protection that any piece of expensive electronics should have. Note that this applies to more than just AC power; surge suppressors are available for (and should be used on) phone lines, and RS-232 and parallel connections (for use on long lines; generally not needed if the devices are colocated with the computer and all devices are protected from outside sources). Note also that devices connected to your computer need to be protected; if you put a surge suppressor on your computer but not your printer, then a zap on the printer may take out the computer, too.An important fact about surge suppressors is that theyneed to be replaced if they absorb a large surge. Besidesfuses, most suppressors rely on on components called Metal-OxideVaristors (or MOVs) for spike suppression, which degrade when theytake a voltage hit. The problem with cheap suppressors is that theydon't tell you when the MOV is cooked, so you can end up with no spikeprotection and a false sense of security. Better ones have anindicator.An important fact about surge suppressors is that . Besides fuses, most suppressors rely on on components called Metal-Oxide Varistors (or MOVs) for spike suppression, which degrade when they take a voltage hit. The problem with cheap suppressors is that they don't tell you when the MOV is cooked, so you can end up with no spike protection and a false sense of security. Better ones have an indicator.You can buy surge suppressors at any Radio Shack; for better prices, gomail-order through Computer Shopper or some similar magazine. All ofthese are low-cost devices ($10-50).You can buy surge suppressors at any Radio Shack; for better prices, go mail-order through Computer Shopper or some similar magazine. All of these are low-cost devices ($10-50).

Line Conditioners

These devices filter noise out of AC lines. Noise can degradeyour power supply and cause it to fail prematurely. They also protectagainst short voltage dropouts and include surge suppression.These devices filter noise out of AC lines. Noise can degrade your power supply and cause it to fail prematurely. They also protect against short voltage dropouts and include surge suppression.The Tripp-Lite 1200 I used to have was typical of the better class ofline conditioners; a box with a good big soft-iron transformer and a coupleof moby capacitors in it and no conductive pathbetween the in and out sides. With one of these, you can laugh atbrownouts and electrical storms. A fringe benefit is that if youaccidentally pull your plug out of the wall you may find you actually havetime to re-connect it before the machine notices (I did this once). But atrue UPS is better.The Tripp-Lite 1200 I used to have was typical of the better class of line conditioners; a box with a good big soft-iron transformer and a couple of moby capacitors in it and conductive path between the in and out sides. With one of these, you can laugh at brownouts and electrical storms. A fringe benefit is that if you accidentally pull your plug out of the wall you may find you actually have time to re-connect it before the machine notices (I did this once). But a true UPS is better.Netter Trey McLendon has good things to say about Zero Surgeconditioners. He says: "Our systems at work [...] have been protected for2.5 years now through many a violent storm...one strike knocked [out] theMOV-type suppressors on a Mac dealer's training setup across the streetfrom us. The Zero Surge just sort of buzzed when the surge came in, withno interruption whatsoever. The basic principle is this: ZS units slowdown the surge with a network of passive elements and then sends it backout the neutral line, which is tied to ground outside at thebox by code. MOV units shunt the surge to ground atthe computer, where it leaps across serial ports, networkconnections, etc. doing its deadly work."Netter Trey McLendon has good things to say about Zero Surge conditioners. He says: "Our systems at work [...] have been protected for 2.5 years now through many a violent storm...one strike knocked [out] the MOV-type suppressors on a Mac dealer's training setup across the street from us. The Zero Surge just sort of buzzed when the surge came in, with no interruption whatsoever. The basic principle is this: ZS units slow down the surge with a network of passive elements and then sends it back out the neutral line, which is tied to ground by code. MOV units shunt the surge to ground , where it leaps across serial ports, network connections, etc. doing its deadly work."Price vary widely, from $40-400, depending on the power ratingand capabilities of the device. Mail-order from a reputable supplyhouse is your best bet. Line conditioners typicallydon't need to be replaced after a surge; check tosee if yours includes MOVs.Price vary widely, from $40-400, depending on the power rating and capabilities of the device. Mail-order from a reputable supply house is your best bet. Line conditioners typically

see if yours includes MOVs.

Uninterruptible Power Supplies

The remainder of this document will focus on UPSes. A UPS does threethings for you. First, it filters the power your machine sees, smoothingout spikes and voltage fluctuations that can stress or even damage yourelectronics. Secondly, it provides a certain amount of dwell time in theevent your power goes out entirely — this can often get you throughbrownouts and short blackouts. Third, when the UPS is about to run out ofpower it can arrange a graceful shutdown of your computer so that nounpleasant things happen to your disk filesystems. While the risks ofunexpected shutdown are much lessened in these days of journallingfilesystems like Linux's EXT3 or JFS from what they once were, ensuring aclean shutdown is still a valuable contribution to any systemadministrator's peace of mind.The remainder of this document will focus on UPSes. A UPS does three things for you. First, it filters the power your machine sees, smoothing out spikes and voltage fluctuations that can stress or even damage your electronics. Secondly, it provides a certain amount of dwell time in the event your power goes out entirely — this can often get you through brownouts and short blackouts. Third, when the UPS is about to run out of power it can arrange a graceful shutdown of your computer so that no unpleasant things happen to your disk filesystems. While the risks of unexpected shutdown are much lessened in these days of journalling filesystems like Linux's EXT3 or JFS from what they once were, ensuring a clean shutdown is still a valuable contribution to any system administrator's peace of mind.Here's what a UPS will do for you:Here's what a UPS will do for you:In addition, some UPS or UPS/software combinations provide thefollowing functions:In addition, some UPS or UPS/software combinations provide the following functions:Many pronounce UPS as "ups", but most of the literature seems tofavor "you pee ess", since they use "a UPS" instead of "an UPS". Thisdocument will try to follow the literature. Neither pronunciation will getyou laughed at by those who are experienced in the field.Many pronounce UPS as "ups", but most of the literature seems to favor "you pee ess", since they use "a UPS" instead of "an UPS". This document will try to follow the literature. Neither pronunciation will get you laughed at by those who are experienced in the field.

UPS Basics

How To Select A UPS

UPSes are nowadays very inexpensive. In the U.S. in 2006, quitecapable ones are available for less than $100, and prices are headingdown. In fact prices are so low now that we're not going to walk you throughthe elaborate optimization step that would have been importanteven two or three years ago, of estiming the watt dissipation of yourcomputer and matching it to a UPS rating. Instead we'll explainwhy this would be a waste of effort and how to buy in a simplerand more effective way.UPSes are nowadays very inexpensive. In the U.S. in 2006, quite capable ones are available for less than $100, and prices are heading down. In fact prices are so low now that we're not going to walk you through the elaborate optimization step that would have been important even two or three years ago, of estiming the watt dissipation of your computer and matching it to a UPS rating. Instead we'll explain why this would be a waste of effort and how to buy in a simpler and more effective way.UPSes are rated by the watts a full battery can put out beforeit drains. However, they are marketed using a VA (voltage-amps)figure; often, consumer-grade UPSes don't even specify a wattage onthe box where you can see it. This is because the VA figure is largerand looks sexier. As a rule of thumb. assume the wattage is half ofthe VA rating; for an explanation of the complexities involved (if youcare) see the white paper UnderstandingPower Factor, Crest Factor, and Surge Factor on the APCwebsite.UPSes are rated by the watts a full battery can put out before it drains. However, they are marketed using a VA (voltage-amps) figure; often, consumer-grade UPSes don't even specify a wattage on the box where you can see it. This is because the VA figure is larger and looks sexier. As a rule of thumb. assume the wattage is half of the VA rating; for an explanation of the complexities involved (if you care) see the white paper [http://sturgeon.apcc.com/whitepapers.nsf/URL/WP-17/$FILE/WP17.pdf Understanding Power Factor, Crest Factor, and Surge Factor] Understanding Power Factor, Crest Factor, and Surge Factor on the APC website.But even if you know the watt rating of the UPS, it is the ratio ofthat figure with the wattage dissipation of your computer thatcontrols the dwell time. Your dissipation is hard to predict; it caneven be effected by things like the size of monitor you use (big onescan be quite power-hungry).But even if you know the watt rating of the UPS, it is the ratio of that figure with the wattage dissipation of your computer that controls the dwell time. Your dissipation is hard to predict; it can even be effected by things like the size of monitor you use (big ones can be quite power-hungry).Manufacturers try to get around this technical thicket byputting an expected dwell time on the box. But they exaggerate andeven lie about their dwell times a lot (this is calledmarketing). What they'll do is quote you the dwelltime you would get driving a bare minimum system with the disk drivesshut off and a tiny monitor, in much the same way laptop manufacturerslie about their battery dwell times. The more honest UPSmanufacturers give you a little table showing expected dwell times fordifferent system configurations (desktop,tower, etc.). As a rule of thumb, assume you will getabout 50% of the dwell time listed on the box for your configurationtype.Manufacturers try to get around this technical thicket by putting an expected dwell time on the box. But they exaggerate and even lie about their dwell times a lot (this is called ). What they'll do is quote you the dwell time you would get driving a bare minimum system with the disk drives shut off and a tiny monitor, in much the same way laptop manufacturers lie about their battery dwell times. The more honest UPS manufacturers give you a little table showing expected dwell times for different system configurations (, , etc.). As a rule of thumb, assume you will get about 50% of the dwell time listed on the box for your configuration type.My advice is to forget the numbers game. Just go online or toyour local computer store and buy one of the higher-end consumer orhome-office models from APC, Best, Tripp-Lite, Belkin, or some otherreputable manufacturer. Go ahead and grab the model with the longestdwell time, highest watt rating, or biggest VA number you can find;the premium for it is not likely to be more than $75 over thebargain-basement model. I guarantee you will feel very good aboutyour decision not to pinch pennies come your first extended poweroutage.My advice is to forget the numbers game. Just go online or to your local computer store and buy one of the higher-end consumer or home-office models from APC, Best, Tripp-Lite, Belkin, or some other reputable manufacturer. Go ahead and grab the model with the longest dwell time, highest watt rating, or biggest VA number you can find; the premium for it is not likely to be more than $75 over the bargain-basement model. I guarantee you will feel very good about your decision not to pinch pennies come your first extended power outage.Perhaps a more compelling reason it is better to over-buycapacity rather than ending up with a UPS that is too weak for yourpower drain is that overstrained UPSes can fail in ugly ways,including catching fire and exploding.Perhaps a more compelling reason it is better to over-buy capacity rather than ending up with a UPS that is too weak for your power drain is that overstrained UPSes can fail in ugly ways, including catching fire and exploding.Be sure you get a line interactive UPSrather than the older standby orSPS type. The older technology doesn'tactually filter your power through the battery, so you're not assuredof good voltage conditioning. The main advantage of an SPS (low cost)has been eroded now that line-interactive UPSes are so inexpensive.There are other UPS types, but they are either obsolescent or targetedat large data-center installations. For a detailed discussion of thedifferent UPS types, see Thedifferent types of UPS systems, a white paper on the APCsite.Be sure you get a UPS rather than the older or

actually filter your power through the battery, so you're not assured of good voltage conditioning. The main advantage of an SPS (low cost) has been eroded now that line-interactive UPSes are so inexpensive. There are other UPS types, but they are either obsolescent or targeted at large data-center installations. For a detailed discussion of the different UPS types, see [http://sturgeon.apcc.com/whitepapers.nsf/URL/WP-1/$FILE/WP1.pdf The different types of UPS systems] The different types of UPS systems, a white paper on the APC site.Another important consideration is how your UPS will communicatewith your computer. Do not buy a serial line UPS (one thatcommunicates via an RS-232C cable). These are passing out of use infavor of UPS designs that use USB or Ethernet, for the very excellentreason that RS-232C interfaces are flaky, difficult to configure,and difficult to debug. Ethernet is overkill for this application;UPSes simply don't need that kind of bandwidth. We recommend sticking with USB, which is well-matched in price/performance to this joband relatively easy to troubleshoot.Another important consideration is how your UPS will communicate with your computer. Do not buy a serial line UPS (one that communicates via an RS-232C cable). These are passing out of use in favor of UPS designs that use USB or Ethernet, for the very excellent reason that RS-232C interfaces are flaky, difficult to configure, and difficult to debug. Ethernet is overkill for this application; UPSes simply don't need that kind of bandwidth. We recommend sticking with USB, which is well-matched in price/performance to this job and relatively easy to troubleshoot.Until recently there was an important distinction betweensmart and dumb UPSes.Dumb UPSes did voltage-level signaling through individual pins; smartones used the link as a primitive character channel and could passmore status information over it. But if you avoid RS232C UPSes youwill never see a dumb one; indeed, it is likely that by the time youread this no dumb UPses will be in production any longer.Until recently there was an important distinction between

Dumb UPSes did voltage-level signaling through individual pins; smart ones used the link as a primitive character channel and could pass more status information over it. But if you avoid RS232C UPSes you will never see a dumb one; indeed, it is likely that by the time you read this no dumb UPses will be in production any longer.Some UPSes advertise that they deliver a sinusoidal waveform. Thosethat don't may be delivering something more like a square wave or a verynoisy sine wave. There are differing schools of thought about howimportant this is. One school of thought holds that one should always runequipment on the best approximation of sinusoidal input that one can, andthat deviations produce harmonics which may either be interpreted as signalif they get through a power supply, or may actually damage theequipment. Another school holds that since almost all computers useswitching-type power supplies, which only draw power at or near the peaksof the waveforms, the shape of the input power waveform is notimportant.Some UPSes advertise that they deliver a sinusoidal waveform. Those that don't may be delivering something more like a square wave or a very noisy sine wave. There are differing schools of thought about how important this is. One school of thought holds that one should always run equipment on the best approximation of sinusoidal input that one can, and that deviations produce harmonics which may either be interpreted as signal if they get through a power supply, or may actually damage the equipment. Another school holds that since almost all computers use switching-type power supplies, which only draw power at or near the peaks of the waveforms, the shape of the input power waveform is not important.Who's right? We don't know. Nick's opinion is that sinusoidal outputis worth the extra money, especially for on-line UPS systems thatcontinually provide their waveform to the computer; Eric is inclined todoubt it matters much with modern power supplies. If you don't know thatyour equipment has a switching-type power supply, you certainly might wantto think twice before buying a low quality UPS.Who's right? We don't know. Nick's opinion is that sinusoidal output is worth the extra money, especially for on-line UPS systems that continually provide their waveform to the computer; Eric is inclined to doubt it matters much with modern power supplies. If you don't know that your equipment has a switching-type power supply, you certainly might want to think twice before buying a low quality UPS.Personally, I (Eric) like APC UPSes (nether Eric nor Nick has anyconnection with the company). But this is not the kind of widget for whichmanufacturer makes a whole lot of difference as long as you stick with oneof the reputable brands.Personally, I (Eric) like APC UPSes (nether Eric nor Nick has any connection with the company). But this is not the kind of widget for which manufacturer makes a whole lot of difference as long as you stick with one of the reputable brands.

Deploying your UPS and other devices: the total picture

Our recommendation for a production Unix environment is aconfiguration like the following:Our recommendation for a production Unix environment is a configuration like the following:If this is too expensive for you, then downgrade the UPS toa line conditioner like the TrippLite. But don't go without at leastthat. Running unprotected is false economy, because youwill lose equipment to electrical storms —and, Murphy's Law being what it is, you will always get hit at theworst possible time.If this is too expensive for you, then downgrade the UPS to a line conditioner like the TrippLite. But don't go without at least that. Running unprotected is false economy, because you

and, Murphy's Law being what it is, you will always get hit at the worst possible time.One thing to note is that you typically shouldn't put a laser printeron the brownout-protected sockets in a UPS — toner heaters drawenough current to overload a UPS and cause a shutdown withinseconds. Modern UPSes generally have some plugs that are markedsurge-suppressed but not filtered through the battery; plug yourprinter into one of those.One thing to note is that you typically shouldn't put a laser printer on the brownout-protected sockets in a UPS — toner heaters draw enough current to overload a UPS and cause a shutdown within seconds. Modern UPSes generally have some plugs that are marked surge-suppressed but not filtered through the battery; plug your printer into one of those.A UPS should be wired directly to (or plugged directly into) theAC supply (i.e. a surge suppressor is neither required nor suggestedbetween the wall and the UPS). In addition, a surge suppressorbetween the UPS and the equipment connected to it is redundant.A UPS should be wired directly to (or plugged directly into) the AC supply (i.e. a surge suppressor is neither required nor suggested between the wall and the UPS). In addition, a surge suppressor between the UPS and the equipment connected to it is redundant.

Software Assistance

Your UPS communicates with your computer so it can gracefullyshut the computer down when an outage has lasted too long for thebattery to cope. In order for graceful shutdown to actually happen,your computer needs to have a background process — a daemon, inUnix terms — watching whatever messages come over the UPS cablefor the one that says terminate. Then itneeds to tell the operating system to shut down.Your UPS communicates with your computer so it can gracefully shut the computer down when an outage has lasted too long for the battery to cope. In order for graceful shutdown to actually happen, your computer needs to have a background process — a daemon, in Unix terms — watching whatever messages come over the UPS cable for the one that says . Then it needs to tell the operating system to shut down.Your UPS probably comes with a CD full of such software. Throwit away, as (a) most of it will be useless bits written for Windowssystems, and (b) in the unlikely event you get Linux software it willalmost certainly be stale binaries for a version you don't run.Your UPS probably comes with a CD full of such software. Throw it away, as (a) most of it will be useless bits written for Windows systems, and (b) in the unlikely event you get Linux software it will almost certainly be stale binaries for a version you don't run.Back in the days of dumb serial-line UPses, there used to beabout half a dozen different open-source UPS monitor daemons:apcd, dumbupsd,genpowerd.powerd, smupsd,usvd and more. These were fairly stupidprograms for a simple job. Many required you to hand-wire a customRS232C cable to get around various evil things that UPS manufacturersdid to their ports in order to lock in customers.Back in the days of dumb serial-line UPses, there used to be about half a dozen different open-source UPS monitor daemons: apcd, dumbupsd, genpowerd. powerd, smupsd, usvd and more. These were fairly stupid programs for a simple job. Many required you to hand-wire a custom RS232C cable to get around various evil things that UPS manufacturers did to their ports in order to lock in customers.Those days are gone. USB UPSes get rid of the cable-hacking andhardware klugery, but require a bit more smarts from a monitor daemon.Accordingly the field has narrowed considerably. There appear to be only two such projects left standing.Those days are gone. USB UPSes get rid of the cable-hacking and hardware klugery, but require a bit more smarts from a monitor daemon. Accordingly the field has narrowed considerably. There appear to be only two such projects left standing.The Network UPSTools project is a generic UPS monitor daemon that aims tocommunicate intelligently with all current UPS designs.The [http://www.networkupstools.org/ Network UPS Tools] Network UPS Tools project is a generic UPS monitor daemon that aims to communicate intelligently with all current UPS designs.apcupsd is a daemonspecifically designed for communicating with UPSes made by APC, theAmerican Power Corporation. [http://www.apcupsd.org/ apcupsd] apcupsd is a daemon specifically designed for communicating with UPSes made by APC, the American Power Corporation.Both are solid, well-run projects. Their development groups aremutually friendly, and there has been occasional talk of a merger.Awkwardly, the apcupsd project is in many waysthe more featureful of the two, with, among other things, better USBsupport and better documentation — but the NUT tools have a cleanerarchitecture, more developers, and acceptance in Red Hat and other majordistributions.Both are solid, well-run projects. Their development groups are mutually friendly, and there has been occasional talk of a merger. Awkwardly, the apcupsd project is in many ways the more featureful of the two, with, among other things, better USB support and better documentation — but the NUT tools have a cleaner architecture, more developers, and acceptance in Red Hat and other major distributions.My advice is simple; run apcupsd ifyou buy an APC UPS, and the NUT tools if you buy anything else. RPMsand Debian packages (which will modify your system's boot sequenceappropriately as well as installing the daemon binaries) are availablefor both, so installation should be easy either way.My advice is simple; run apcupsd if you buy an APC UPS, and the NUT tools if you buy anything else. RPMs and Debian packages (which will modify your system's boot sequence appropriately as well as installing the daemon binaries) are available for both, so installation should be easy either way.

Preparing Your System For Auto-Reboot

If you are using your UPS to try to keep a DNS/Web/mailserver up24/7, you will want to make sure the machine can be configured toboot automatically when it is powered up.If you are using your UPS to try to keep a DNS/Web/mailserver up 24/7, you will want to make sure the machine can be configured to boot automatically when it is powered up.This is not the normal behavior of most computers as shippedfrom the factory. Normally after the power is cut and restored, youmust explicitly press a button for the power to actually be turnedon. You can test your computer by powering it down; shutting off thepower (pull the plug); then plugging the cord back in. If yourcomputer immediately starts up, good. There is nothing more todo.This is not the normal behavior of most computers as shipped from the factory. Normally after the power is cut and restored, you must explicitly press a button for the power to actually be turned on. You can test your computer by powering it down; shutting off the power (pull the plug); then plugging the cord back in. If your computer immediately starts up, good. There is nothing more to do.If your computer does not start up, manually turn on thepower (by pressing the power on button) and enter your computer'sSETUP program (often by pressing DEL during the power up sequence;sometimes by pressing F10). You must then find and change theappropriate configuration parameter to permit instant poweron.If your computer does not start up, manually turn on the power (by pressing the power on button) and enter your computer's SETUP program (often by pressing DEL during the power up sequence; sometimes by pressing F10). You must then find and change the appropriate configuration parameter to permit instant power on.Normally, this is located under the BOOT menu item, and will be called somethingsuch as Restore on AC/Power Loss orFull-On. The exact words will varyaccording to the ROM BIOS provider. Generally you will have threeoptions: Last State, Power On, and PowerOff.Normally, this is located under the menu item, and will be called something such as or . The exact words will vary according to the ROM BIOS provider. Generally you will have three options: , , and .Some BIOSes do not support such an option. This is idioticallybad design, but it does happen. If so, your only practical remedy is to get a new motherboard.Some BIOSes do not support such an option. This is idiotically bad design, but it does happen. If so, your only practical remedy is to get a new motherboard.

Testing Your UPS

To test your UPS, throw the circuit breaker with the UPS on it tosimulate and outage and see how the transition goes. Note that in generaltesting an UPS by pulling the plug from the wall is not a goodidea. Electronics like to always have a good ground reference. If youunplug a UPS, it's still powered but now has what electricians call a"floating ground". Not only can this be bad for electronics, but it can bequite dangerous as well. It is likely that unplugging just about any UPSfor a short amount of time isn't likely to result in disaster (don't takeour word for it, though!), but in all cases, throwing a circuit breakerwould be a better thing to do.To test your UPS, throw the circuit breaker with the UPS on it to simulate and outage and see how the transition goes. Note that in general testing an UPS by pulling the plug from the wall is not a good idea. Electronics like to always have a good ground reference. If you unplug a UPS, it's still powered but now has what electricians call a "floating ground". Not only can this be bad for electronics, but it can be quite dangerous as well. It is likely that unplugging just about any UPS for a short amount of time isn't likely to result in disaster (don't take our word for it, though!), but in all cases, throwing a circuit breaker would be a better thing to do.It might be useful to install a GFI (Ground Fault Interrupter) on yourUPS-covered outlets to facilitate this testing without having to throw abreaker, especially if you don't have your UPS protected machines on anisolated circuit (which you probably should). These are the sockets foundin most modern kitchens and bathrooms with a red and a black button. Youpush the latter to cut power and the former to restore power.It might be useful to install a GFI (Ground Fault Interrupter) on your UPS-covered outlets to facilitate this testing without having to throw a breaker, especially if you don't have your UPS protected machines on an isolated circuit (which you probably should). These are the sockets found in most modern kitchens and bathrooms with a red and a black button. You push the latter to cut power and the former to restore power.

Maintaining Your UPS

Make sure the UPS keeps in contact with its electrical ground at alltimes. Don't overload it. If it shows signs of misbehavior ormalfunction, yank it until it's repaired, or replace it.Make sure the UPS keeps in contact with its electrical ground at all times. Don't overload it. If it shows signs of misbehavior or malfunction, yank it until it's repaired, or replace it.Your UPS has a battery inside it. Usually it is a lead-acidtype (those are the least expensive for the manufacturer), but both lithium and gel-cel batteries are sometimes used.Your UPS has a battery inside it. Usually it is a lead-acid type (those are the least expensive for the manufacturer), but both lithium and gel-cel batteries are sometimes used.The battery is by far the most vulnerable and failure-prone partof your UPS. If you have your UPS long enough, you will probably havebattery problems. Once every six months to a year or so you shouldrecalibrate your UPS's battery sensor, and once every several yearsyou will have to replace the batteries.The battery is by far the most vulnerable and failure-prone part of your UPS. If you have your UPS long enough, you will probably have battery problems. Once every six months to a year or so you should recalibrate your UPS's battery sensor, and once every several years you will have to replace the batteries.

Service contracts

Some consumer-grade UPSes, and all UPSes designed for seriousdata-center use, can be bought with vendor service contracts. These don'tmake sense for low-end units that can be replaced cheaply from a localelectronics store. If you're an IT shop with a bunch of UPSes scatteredover a campus, a service contract might make sense, depending on circumstances.If you have a larger UPS in the 5-10 KVA range, a service contract may be a valuable hedge against extended downtime.Some consumer-grade UPSes, and all UPSes designed for serious data-center use, can be bought with vendor service contracts. These don't make sense for low-end units that can be replaced cheaply from a local electronics store. If you're an IT shop with a bunch of UPSes scattered over a campus, a service contract might make sense, depending on circumstances. If you have a larger UPS in the 5-10 KVA range, a service contract may be a valuable hedge against extended downtime.

Extending battery life

To extend your battery life, (a) avoid deep discharges, and (b)don't expose them to extremes of heat, cold, or humidity.Unfortunately there is not much you can do to avoid deep-dischargingyour UPS other than living in an area where power outages are fewand short.To extend your battery life, (a) avoid deep discharges, and (b) don't expose them to extremes of heat, cold, or humidity. Unfortunately there is not much you can do to avoid deep-discharging your UPS other than living in an area where power outages are few and short.

Recalibrating Your UPS

Your UPS's dwell-time calibration will lose accuracy over the lifeof the battery. The usual symptom of this problem is that the UPSoverestimates the dwell time it has remaining during outages, butoccasionally it can also lead to an actual bad-battery condition going undetected and very odd symptoms as a result.Your UPS's dwell-time calibration will lose accuracy over the life of the battery. The usual symptom of this problem is that the UPS overestimates the dwell time it has remaining during outages, but occasionally it can also lead to an actual bad-battery condition going undetected and very odd symptoms as a result.UPSes have a recalibration procedure built into their firmware.It generally involves deep-discharching and recharging the batterywhile the UPS is in a special test mode. Your recipe for triggering such a recalibration will vary according to your UPS software.UPSes have a recalibration procedure built into their firmware. It generally involves deep-discharching and recharging the battery while the UPS is in a special test mode. Your recipe for triggering such a recalibration will vary according to your UPS software.You always need to do this when you install new batteries (seebelow). It is a good idea to do it once every six to twelve months as routine maintenance, but no more often than that; as we notedpreviously, deep discharges shorten your battery life.You always need to do this when you install new batteries (see below). It is a good idea to do it once every six to twelve months as routine maintenance, but no more often than that; as we noted previously, deep discharges shorten your battery life.

Replacing Your Batteries

All modern UPSes have a low-battery alarm and run a periodicself-test; they will alert you when replacement is needed. Usuallythey both flash an indicator and make an alarm sound. If you have amonitoring daemon set up, they will alert it and you will probably getwarning mail. If you ignore the alarm it will time out, but berepeated at intervals.All modern UPSes have a low-battery alarm and run a periodic self-test; they will alert you when replacement is needed. Usually they both flash an indicator and make an alarm sound. If you have a monitoring daemon set up, they will alert it and you will probably get warning mail. If you ignore the alarm it will time out, but be repeated at intervals.You will occasionally get a false alarm. It's a good idea, if youget an alarm, to explicitly trigger a UPS self-test the next day and see ifthe alarm goes away (the procedure for doing this varies depending onyour UPS software). If the alarm is persistent, you need to replacethe batteries.You will occasionally get a false alarm. It's a good idea, if you get an alarm, to explicitly trigger a UPS self-test the next day and see if the alarm goes away (the procedure for doing this varies depending on your UPS software). If the alarm is persistent, you need to replace the batteries.It has been reported that bad batteries can also produce symptomsthat mimic inverter failures or wonky control electronics. Even ifyour UPS is displaying epileptic symptoms like repeating alarms andflashing panel lights, a bad battery is the first thing tosuspect.It has been reported that bad batteries can also produce symptoms that mimic inverter failures or wonky control electronics. Even if your UPS is displaying epileptic symptoms like repeating alarms and flashing panel lights, a bad battery is the first thing to suspect.UPS manufacturers would of course prefer that you replace yourentire UPS when the batteries die, since they make more money thatway. But in fact there is nothing unique or magic about UPS batteries.They are standard types also used for other applications such aspowering marine electronics, with standard connectors. You can buythem from sources other than the UPS manufacturer, and sometimes replacethem with equivalents that are better and less expensive.UPS manufacturers would of course prefer that you replace your entire UPS when the batteries die, since they make more money that way. But in fact there is nothing unique or magic about UPS batteries. They are standard types also used for other applications such as powering marine electronics, with standard connectors. You can buy them from sources other than the UPS manufacturer, and sometimes replace them with equivalents that are better and less expensive.It's best to wait until the low battery alarm before ordering areplacement; keeping batteries on the shelf reduces their life unlessyou keep them fully charged.It's best to wait until the low battery alarm before ordering a replacement; keeping batteries on the shelf reduces their life unless you keep them fully charged.Do not throw old batteries in your regular trash! They containtoxic metals and acids. Be kind to your environment and hand them toa qualified party for recycling. Most battery dealers will cheerfullydo this for you. If not, your local garbage company or waste-disposalauthority can explain to you how and where to turn them insafely.Do not throw old batteries in your regular trash! They contain toxic metals and acids. Be kind to your environment and hand them to a qualified party for recycling. Most battery dealers will cheerfully do this for you. If not, your local garbage company or waste-disposal authority can explain to you how and where to turn them in safely.Many UPS models use gel-cel batteries in standard formats like 12.0V, 7.2Ah (151x64x94 mm). Warning: Many manufactors sell two or threedifferent types: standard use, cyclic use and high-current use. UPSesrequire high-current and some UPS don't work well with batteries forstandard use, because the voltage goes low too early under high load (theUPS turns off too fast or the output voltage drops so that the computerturns off). Standard batteries are for alarm devices, emergency lights orthings like that. For instance Panasonic sells the "LCR127R2PG1"(standard), and "UPRW1245P1" (high current), Fiamm the "FG20271" (standard)and "FGH20902" (high current), CSB the "GP1272" (standard) and "HR 1234W"(high current).Many UPS models use gel-cel batteries in standard formats like 12.0 V, 7.2Ah (151x64x94 mm). Warning: Many manufactors sell two or three different types: standard use, cyclic use and high-current use. UPSes require high-current and some UPS don't work well with batteries for standard use, because the voltage goes low too early under high load (the UPS turns off too fast or the output voltage drops so that the computer turns off). Standard batteries are for alarm devices, emergency lights or things like that. For instance Panasonic sells the "LCR127R2PG1" (standard), and "UPRW1245P1" (high current), Fiamm the "FG20271" (standard) and "FGH20902" (high current), CSB the "GP1272" (standard) and "HR 1234W" (high current).Below, you will find some suggestions for buying replacementbatteries. One important note of caution: atleast one user purchased one of the aftermarket batteries noted belowand found out that they would not fit into his unit. This requiredcutting and soldering and other very undesirable things, so beextremely careful in measuring your batteries — including everymillimeter of the terminal connections, which can causeproblems.Below, you will find some suggestions for buying replacement batteries. One note of caution: at least one user purchased one of the aftermarket batteries noted below and found out that they would not fit into his unit. This required cutting and soldering and other very undesirable things, so be extremely careful in measuring your batteries — including every millimeter of the terminal connections, which can cause problems.Although you can do a hot swap of your batteries while thecomputer is running, it may not be very satisfactory, because the unitwill not know that the batteries have been swapped and your monitordaemon will continue to show a low-battery indication. To correctthis situation, you must do a discharge and recharge of thebattery. At that point the battery should be calibrated better.Although you can do a hot swap of your batteries while the computer is running, it may not be very satisfactory, because the unit will not know that the batteries have been swapped and your monitor daemon will continue to show a low-battery indication. To correct this situation, you must do a discharge and recharge of the battery. At that point the battery should be calibrated better.It may take several discharges and recharges of new batteriesbefore they reach full capacity and the dwell-time calibration isaccurate. If your UPS contains two or more battery units and yourmonitoring software reports separate voltage levels for them, one way to tell is to watch the divergence in voltage levels. As the cellsreach nominal full capacity, their voltages should converge.It may take several discharges and recharges of new batteries before they reach full capacity and the dwell-time calibration is accurate. If your UPS contains two or more battery units and your monitoring software reports separate voltage levels for them, one way to tell is to watch the divergence in voltage levels. As the cells reach nominal full capacity, their voltages should converge.

Buying Batteries

APC makes "Replacement Battery Units" for each of theSmartUPS models, but they sell them directly only in the U.S. Yourlocal Yamaha SeaDoo shop (if you have one) carries 35 ampere-hour deepcycle marine batteries that are direct replacements for the kind APCuses in many of its models. These are gel-cel and will double theruntime and/or cut your recharge time in half. Here are some WestCoast sources:APC makes "Replacement Battery Units" for each of the SmartUPS models, but they sell them directly only in the U.S. Your local Yamaha SeaDoo shop (if you have one) carries 35 ampere-hour deep cycle marine batteries that are direct replacements for the kind APC uses in many of its models. These are gel-cel and will double the runtime and/or cut your recharge time in half. Here are some West Coast sources:  Jet Works 1587 Monrovia Ave. Newport Beach CA 9266? Tel: +1 714 548-5259 J-W Batteries, Inc. Tel: +1 714 548-4017 WPS 49-1200 GEL-CELL KB-35 BATTERY  The company I've heard most strongly recommended (by CarlErhorn, a core developer on the apcupsdproject) is called Battery Wholesale Distributors of Georgetown,Texas. If you have questions, you can reach them by phone at (800)365-8444, 9:00AM to 5:00PM (their local time), Monday throughFriday. Carl reports having gotten email from them on the weekends,although the office is not open then.The company I've heard most strongly recommended (by Carl Erhorn, a core developer on the apcupsd project) is called Battery Wholesale Distributors of Georgetown, Texas. If you have questions, you can reach them by phone at (800) 365-8444, 9:00AM to 5:00PM (their local time), Monday through Friday. Carl reports having gotten email from them on the weekends, although the office is not open then.The web site, with current pricing, is www.batterywholesale.com.They will ship outside of the US, they take all the usual creditcards, and they accept orders by phone or Web.The web site, with current pricing, is [http://www.batterywholesale.com www.batterywholesale.com] www.batterywholesale.com. They will ship outside of the US, they take all the usual credit cards, and they accept orders by phone or Web.Carl reports that BWD has found manufacturers who make batteriesin the standard case sizes, but have additional capacity over originalUPS batteries. Often, the difference is as much as 15% or so, and thiscan result in additional runtime. It's a nice upgrade for a minorincrease in price.Carl reports that BWD has found manufacturers who make batteries in the standard case sizes, but have additional capacity over original UPS batteries. Often, the difference is as much as 15% or so, and this can result in additional runtime. It's a nice upgrade for a minor increase in price.BWD is also 'green-aware', in that they encourage you torecycle your old batteries, and will accept the old batteries backfrom you if you cannot find a local place that recycles them. Youpay the shipping but other than that, there is no charge.BWD is also 'green-aware', in that they encourage you to recycle your old batteries, and will accept the old batteries back from you if you cannot find a local place that recycles them. You pay the shipping but other than that, there is no charge.Carl says I've been very pleased with theirproducts, service, and pricing. I hope you find them as helpful toyou as I do. I've been dealing with them since about 1994, and havenever been disappointed. The owner of the place also is very goodon technical issues, so if you have questions on their products, hecan get as technical as you need to go.Carl says

Vendor information

Note: Many of these manufacturers make specialty systems forlarge data centers, not the consumer-grade UPSes that we cover inmost of the rest of this document.Note: Many of these manufacturers make specialty systems for large data centers, not the consumer-grade UPSes that we cover in most of the rest of this document.There are a lot of companies in this space, and there's no way thatwe can list all of them. We try to include most of the best known companiesalong with a few niche players that might be of interest to the readers ofthis document. Let me know if there are important companies that we haven'tincluded.There are a lot of companies in this space, and there's no way that we can list all of them. We try to include most of the best known companies along with a few niche players that might be of interest to the readers of this document. Let me know if there are important companies that we haven't included.

Bibliography

One critical source of information on power protection is the IEEE"color book" series, especially the following:One critical source of information on power protection is the IEEE "color book" series, especially the following:The Emerald Book, IEEE Recommeded Practice for Powering and Grounding Electronic Equipment, Std. 1100-1999, 1999.The Emerald Book, IEEE Recommeded Practice for Powering and Grounding Electronic Equipment, Std. 1100-1999, 1999.The Gold Book, IEEE Recommended Practice for the Design of Reliable Industrial and Commercial Power Systems, Std. 493-1997, 1997.The Gold Book, IEEE Recommended Practice for the Design of Reliable Industrial and Commercial Power Systems, Std. 493-1997, 1997.The Green Book, IEEE Recommended Practice for Grounding of Industrial and Commercial Power Systems, Std. 241-1990, 1990.The Green Book, IEEE Recommended Practice for Grounding of Industrial and Commercial Power Systems, Std. 241-1990, 1990.

Substantial portions of this document, notably the bits onmaintaining your UPS, were originally part of theapcupsd documentation. The projectmaintainers have graciously permitted me to re-use them here. Otherparts were part of my UnixHardware Buyer HOWTO.Substantial portions of this document, notably the bits on maintaining your UPS, were originally part of the apcupsd documentation. The project maintainers have graciously permitted me to re-use them here. Other parts were part of my [http://www.tldp.org/HOWTO//Unix-Hardware-Buyer-HOWTO/ Unix Hardware Buyer HOWTO] Unix Hardware Buyer HOWTO.There was a previous UPS HOWTO by Harvey J. Stein, last updatedin 1997. It was so out of date that I ended up using none of it.There was a previous UPS HOWTO by Harvey J. Stein, last updated in 1997. It was so out of date that I ended up using none of it.

UPS_HOWTO (last edited 2008-09-18 17:34:31 by SvetoslavChukov)