|For a start it is not a CPU, it is a computer. The CPU is a single chip on the motherboard. The largest one there with a fan and a heat-sink on it.|
It is not unusual for a computer to come on then turn of when power is first applied. There are settings in the BIOS that will prevent this but its not a problem.
The CMOS battery failure is something you can fix very easily. The CMOS battery is a small coin battery on the motherboard that retains settings like time and date in the CMOS memory when the computer is shut down.
The fact that it only happens when the UPS is turned on is to be expected as modern PC delivers a small amount of power to the motherboard even when they are switched off. It is this small amount of power that is retaining the settings in the CMOS memory.
The only way to remove all power to the computer is to remove the power cord or turn the UPS off. That is when the CMOS memory loses its contents.
The solution is to replace the CMOS battery and all the problems should disappear. The battery is cheap and can be got for any computer shop of photographic shop. The same type of battery is often used in cameras.