I'm trying to get a CentOS 5.4 server to hibernate when the system has been inactive for a while. By inactive I mean there are no incoming network connections.
I can get the system to hibernate and also make it wake-up over the network. What I need to know is how to configure the system to monitor the network traffic and go into hibernation after a while, say 2 hours.
If it is a server, then which services needs to be up? If you serve HTTP only and need SSH also, just monitor HTTP, HTTPS and SSH traffic and if it is idle for more than X minutes hibernate it. You can use tshark to check this.
How good are your scripting skills? (or server monitoring system)
You may be able to get away with sampling the TX/RX bytes on your ethernet interface(capture the output of ifconfig, or parse /proc/net/dev), and if it's lower than a certain threshold after 1 hr, initiate the hibernation sequence?
I'm not aware of an out-of-the-box solution for something like this, but I can see how something like this would be useful. Google has many data centers, and move load + power consumption to areas that are active @ that time of day.