I think this is an old topic I'm revisiting but just wanted to see if anyone else has ran into anything new on this subject.

The problem: commercial power loss for unattended servers. Attach a UPS. OK that's good. Set energysaver to shut down computer when 10% of ups power remains etc. Also good. Power out for an hour. Comes back. Good. Server remains turned off until someone gets back onsite to press the power button. not good.

Other option: do not set server to shut off on low ups power. not good. set energysaver to restart after power loss. ok. power goes out for an hour. computer experiences hard power loss, possible hardware damage, and possible disk corruption. not good. power comes back on. server restarts and hopefully is ok and can fix any directory issues that were created.

so... we have a lose/lose situation here really. We can either take the safe approach and have to make a road trip to press a power button. (or phonecall to someone with the right key etc) OR we risk directory corruption or possible hardware damage.


To mitigate this, I have created a script WakeStick that crons every minute and checks pmset's indicators for UPS status. When "on battery power" appears, a message is emailed. When power is restored, another email is sent. Every 10 minutes another email is sent with an update on estimated UPS time. Energysaver is relied on to shut down the computer when UPS power gets low or runtime has reached the limit.

However, every time WakeStick is cronned, it builds a new set of "power on" alarms into pram. They are configurable, but generally speaking they're set to power on 30 minutes from current time, plus every 15 minutes thereafter for a few more hours, and then two more an additional 6 and 12 hours later. When the server comes back up again, another email notice is sent.

This gets the machine to soft power off before total power loss, and gets it back on again as fast as is reasonably possible.


Is there another good solution to this issue? I'm amazed that I don't find anything built into the Mac OS that will handle this common scenario reasonably well.



(I am also planning a few upgrades to wakestick here, one already in place uses an external smaller ups to provide power notices in the case where a large ups cannot talk to the mac, the other I have not yet implemented will ping another device on the lan that is NOT on a ups and use it in the same way as the little ups - in those cases wakestick does the power-down after a preset amount of time on battery power since it can't tell how much battery remains)


I work for the Department of Redundancy Department