I have several Linux servers connected to APC UPSs. They are connected to the UPS via USB and configured to shutdown if the UPS sends a signal that mains power has been lost and has not returned after a period of time. This works well. In addition they are configured via jumpers to automatically power on if power is lost and then returns. This also works well.
The scenario that is causing issues is when mains power is lost, and the server shuts down, but then mains power is restored before the UPS runs out. In that case we'd like the Server to start up again, but since power is never actually lost post-UPS, the server never sees a power-return event and therefore doesn't power on.
I'm hoping there exists a device that can plug into mains power pre-UPS, and sense the power return state and send wake up signals perhaps via Wake-on-Lan to preconfigured servers to wake them up once mains power has returned that someone can point me to.
Alternate suggestions are also appreciated, only thing I can't do is replace the server hardware, and I'd prefer to keep the same UPSs if possible.
The typical scenario implemented when using UPS is:
In most server BIOSes you can set the system to restore power state from before power loss. This means, that if the server is powered down and power is lost, it will remain powered down after you plug it in. On the other hand, if it was powered on, when the power was lost, it will power up when AC is restored.
NUT mentioned by BillThor should allow you to realize this scenario.
This problem I solved by using one small linux box (Asus wl deluxe or smth) which was plugged into main UPS and wake ASAP as the power was restored. The startup script include a 5 min delay to avoid any variations in power status (up/down), WOL-ed all servers (all w2k3, one linux) and sms me with the status.
After reading many suggestions, I think that a good solution is to use any old computer (if you don't care about power consumption), or some kind of raspberry pi, connected direct to energy.
So, when power goes up, one script will check if servers is on, and if not, then send a OWL through network.
I use NUT (Network UPS Tool) for cases like this. You will need a Unix/Linux based server to monitor the UPS. Once the shutdowns start, it will ensure the UPS is power cycled. This will bring the servers back up if they restart on when power is restored.
There is a client for Windows servers so they can be shut down cleanly.
If your BIOS has the possibility to set a power-up-time you could set it to 50 minutes after shutdown, if shutdown is triggered through the UPS-shutdown-signal.
So in your scenario the server would be up an running again after 50m + boot + shutdown-time latest.
I like all of the previously mentioned ideas. I would like to suggest running the "NUT" server or the "WoL" server on a laptop, with the lid closed. This way, it can run for 4-6 hours just on battery alone. Some laptops can have 2 batteries installed at once for even long run times.