my friend brought a new system with a v guard splendid 600va ups but i touched the back of the cabinet to insert usb i got electric shock..the cpu line and monitor was connector to ups but the main has earthing problems i thought that the ups will prevent earthing problems..my question is whether there is a problem in ups because i thought that ups will protect earthing problems..
As das_stig stated your main panel must be grounded.
This also translates to the wall sockets which should also be grounded.
The ups could be damaged itself eventually if not plugged into a properly grounded electrical grid.
Don't know codes in your neck of the woods.
But even grounding the main panel to your water service main intake pipe is a form of grounding.
In N.A. mains are required to be grounded outside with earth grounds(pipe) as well as inside on the main water service.