One of my servers has been rebooting, about once per month. This is annoying, but not devastating. However, I decided to have a look at it.
When a computer acts like this, these are the likely causes, in order of likelihood
3. Power supply4. Motherboard
Fans are mechanical, and wear out . It's easy to spot when a fan isn't working, because the fan isn't working. In this case, all the fans were working.
Memory gives up after several years. I don't know the exact cause, but I suspect cosmic rays. I have a memory test program - in this case, it passed the test .
Power supplies have a lot of electronic components. The fans can wear out (which is obvious) or a capacitor can weaken. I have a PSU tester; when I plugged it in, it beeped many times and told me that the 3.3 volt supply was all over the place. So I think that was the problem. I replaced the PSU, and put the computer back on the rack.
Motherboards fail with the capacitors. CPUs hardly ever fail. The only way I know of testing a motherboard or CPU is to replace it. I bought a whole bunch of motherboards, CPUs and memory on eBay for £20 each, and they will last me quite a long time.