Uninterruptible Power Supply (UPS) batteries have an expected lifespan of 3 to 5 years and need upkeep and maintenance just like your rechargeable camera and flash batteries. Unfortunately, after a failed self-test, maintenance pretty much translates to battery replacement for high-end units or upgrading to a new UPS for low-end consumer units. And, whether replacing just the battery or the full unit, the old lead-acid battery needs to be disposed of properly at your local dump or transfer station.
The good news is that most UPS batteries are user-replaceable and vendors like APC provide battery replacement guides that will assist in finding new batteries or recommend discounted UPS replacements through trade-in programs such as APC Trade-UPS.
The APC BACK-UPS XS 1500VA LCD that protects my desk failed self-test after just one year of service and needed an APC RBC #109 replacement battery. Such a short battery lifespan is rare but a $65 battery is easier on the wallet than a whole new $300 UPS.
The APC Back-UPS XS 1500VA that protects the rack of network hardware has been in service since April of 2003 and not only got an APC RBC #33 but also got upgraded with an APC External Battery Pack for Back-UPS RS/XS 1500VA.