this is nothing to do with your computer, your UPS or the MAIN switch board has the terminals incorrectly done with. To get around this issue do the following.
Step 1: If you have a UPS which has all plastic covering, u will not know the problem. It seems your UPS in BODYED out. Which simply means the body of the UPS is getting the currect which is in turn suppling current to your computer.
Step 2: Disconnet the UPS from the computer and take an tester (screw driver with tester in it )
Step 3:Keeping the computer Disconnected from the UPS, Now switch on the UPS Switch on your Wall Switch board, put the Screw driver in the iron part of the UPS if it glows, there is a leak of current on to the body of the UPS, if this does not glows the light of the tester, go to step 4.
Step 4: Repeat step 3 but this time also switch on the UPS (with out computer attached to it) and see if the tester glows. If yes, go to step 5
Step 5: Take the UPS to an expert UPS technician to fix the problem.
Method II
There could also be a leak inthe Wall Socket itself, call an expert electrician to check and rectify it.
Hope this will slove your wierd problem.