Diligence, it won't be under warranty. That computer is REALLY old - most warranties at the most cover 5 years. That thing is from either 2004 to 2005, making it at least 8 years old.
Its probably the power supply. Power supplies degrade over time and lose their efficiency. It's not a guarantee - but say a 500 watt PSU is 80% efficient brand new. Pulling this number out of my ass, in five years that efficiency can degrade to just 60%. Now with that computer I'd say its probably 300 watts or lower. At 60% efficiency its possible the PSU can no longer provide enough juice. It's not hard to replace the PSU in a desktop, just a pain to unplug everything and re-plug it (especially if Compaq did any cable management).
Barring that, it'll be a motherboard issue. At that point, replace the desktop. Retrieve the hard drive though and take the rest to a recycling center.