iMac restarting on its own
About a year ago my iMac started restarting on its own. Thinking it was the HDD I swapped it with an SSD + HDD (a new one) setup.
Everything went well until a couple of months ago when it started restarting on its own once again. Sometimes it will work perfectly, while others it will just keep restarting until I uplug the cable.
I tried reinstalling Mac OS and for a while it worked flawlessly, but after some time it started behaving as before.
Running Onyx maintenance script sometimes stops the reset and allows me to use it for a day or so.
Is there anything I could try to troubleshoot it?
Thanks in advance