I've done quite a bit research on this for servers, namely how to build a cluster of cheap servers on the cheap.
One option is to use Arduino with a Relay board and Ethernet Shield.
That will give you maximum of around 40 relays, depending upon model of Arduino used etc.
Parts can be sourced from:
http://arduino-direct.com and eBay
Some information:
http://arduino-info.wikispaces.com/ArduinoPower#4-8As for finished product i ended up choosing IP Power 9258T and Avocent Direct PDU for initial setups for it's low buy-in price.
For KVM i ended up choosing Belkin Omniview for larger setups and Aten CS1716i for smaller setups.
For big setups Belkin Omniview works out somewhere around 30-40$ per node, depending upon do you get your gear from cheap or expensive place.
Aten CS1716i is a few $ more expensive per node only, but the Belkin also provides saner setup by the means of using CAT5 cabling

Back in July I built an arduino resetter that hooked to both reset and power. Had feedback to show when the computer was on/off. Temp monitoring for ambient and room temp. I wrote the GUI to interface with a control computer (yes, parallel port would probably have been easier but I had the arduino).
Right after I got it done I never needed it again. I got my rigs to the stable point where they do not shut down unless the power is lost. I was going to do an instructable but I got busy with other things.