Hi Rafa
Here are some suggestions to clarify the issue
1. Remove UPS and reboot system. If the system shutdown again, you could check your system setting (remove graphic cards or some parts to reboot), or offer your system setting to us.
2. If the system work fine without UPS, please show your UPS model and we could check the event ID and try to analysis the issue.