I'm using apcups with a CyberPower CP1000AVRLCDa that I just bought, and its working great with my Linux Mint machines.
You can even set it up in a situation with more than one computer on the same UPS, one is the master and connects to the UPS via the USB cable, the others talk to the apcupsd on that master and should be configured to shut down before the master does.
However, directly to your question - you need a way to detect power outage. If the UPS doesn't supply it (via some sort of 'relay' (switch), or via ethernet, or serial, or USB), then you'll need another way to detect loss of power so you can shut down.
I suppose a silly way to detect loss of power would be to have another computer that isn't connected to the UPS whose only purpose is to quit talking to the 'protected' computer when it loses power, so that the protected computer will know that power just went off and shut itself down. (Did that make any sense?)
A better way would be some sort of input to your PC that changes based upon presence of AC power in the room. Besides another computer whose only purpose is to die upon loss of power, you could perhaps set up a device that sets a bit on the parallel port to one value when power is present and to the opposite value when the power goes out. I can think of many ways to do this, from a box with an LED powered by the mains which illuminates a photodiode or similar which then pulls the parallel port bit the appropriate way, to a latching relay that is powered by the mains, and that uses the free contacts to pull your parallel port bit appropriately. Before you turn your computer on, latch the relay on first so that your computer sees the power as good. Then, when power goes off the relay drops out and stays off, telling your computer to shut down.
On the other hand, if your power might randomly bounce for a few seconds and then come back so you don't want a single power loss event to kill your pc, then don't use a latching relay - use a 'regular' relay connected to the mains and thus provide a real-time indication of the power state. On the pc, watch that line and if it goes 'no power' for some length of time, shut down.
Note - the above is a somewhat short set of ideas of how to detect power loss on your computer so you can make it shut down. I'm assuming some level of electronic understanding here... And be VERY CAREFUL with anything directly connected to the power mains!
3Does your UPS have a USB cable or port? Most even basic UPS's these days do. Connect it up and check the manufactures website for a linux script and setup instruction. – Tyson – 2014-08-15T05:32:11.157
@Tyson thank you, but I'm afraid it does not. – Spaceman – 2014-08-15T05:42:47.530
1Most UPS devices, as said, have USB, but many have RS232 (serial) ports. For exactly this situation. What is your UPS make and model? – Kinnectus – 2014-08-15T07:00:12.210