It sounds like your UPS might need a new battery. Three years is not an unreasonable lifetime for a UPS battery.

If your computer is experiencing loss of power *while the UPS is connected to the mains*, the unit might have developed a fault.

<sup>(Answering here on the expectation that both the question and the answers will be migrated to superuser.com)</sup>