Any of the APC "Smart" Series will attach to the host PC via a special serial cable or USB on newer models. APC has a program they call "Power Chute" that runs on the PC (or Server) that provides an interface to the UPS and logs all kinds of information. Power Chute logs the temperature of the UPS, line voltage, and any "events" such as brown outs and power failures. When the UPS is on battery and the battery is nearing depletion the Server will shut down gracefully. I'm sure other UPS manufacturers have similar products.
Here is an excerpt from our event log:
03/01/04 06:00:11 Scheduled UPS self-test passed
03/08/04 06:00:13 Scheduled UPS self-test passed
03/10/04 10:41:02 UPS on battery: Deep momentary sag 105.1 V
03/10/04 10:41:02 Normal power restored: UPS on line
03/11/04 07:50:23 UPS on battery: Blackout 000.0 V
03/11/04 07:50:25 Normal power restored: UPS on line
03/11/04 07:57:47 UPS on battery: Deep momentary sag 080.6 V
03/11/04 07:57:47 Normal power restored: UPS on line
=====
If you setup your server to automatically start when power is restored then it should restart automatically after an extended power outage has depleted the UPS battery.
You can then determine the length of the outage from either the server event log or the APC log on the server.