How to shut down a server on my LAN when a power outage is detected?
by road hazard from LinuxQuestions.org on (#5MEWE)
I have my main server (Debian based) at the house here hooked up via USB to a UPS. When the battery level reaches critical, it's configured (via the Power Settings app) to shut down. As it's shutting down due to critical battery level, I want it to send a command to my hardware firewall (Untangle.... based on Debian) and instruct it to also shut down.
I was thinking about putting a SSH script in rc0.d to do this but realized that if I ever bring down the server to work on it, I will inadvertently trigger a shutdown of the Untangle box as well. So, I only want the Untangle box to shutdown when there is a power outage and the battery on my main server is critical. From reading around, NUT might accomplish this goal but isn't officially supported with Untangle so I'd rather look for another solution. Any ideas?
TLDR: How to fire off an SSH command from server A to server B, when server A's UPS battery level reaches critical.
I was thinking about putting a SSH script in rc0.d to do this but realized that if I ever bring down the server to work on it, I will inadvertently trigger a shutdown of the Untangle box as well. So, I only want the Untangle box to shutdown when there is a power outage and the battery on my main server is critical. From reading around, NUT might accomplish this goal but isn't officially supported with Untangle so I'd rather look for another solution. Any ideas?
TLDR: How to fire off an SSH command from server A to server B, when server A's UPS battery level reaches critical.