On 18/02/16 11:59, Mark Rogers wrote:
I had a couple of power cuts yesterday so today I have installed an APC UPS.
Connecting the USB cable to my Ubuntu PC has given me a battery icon showing status so everything "just works" without messing around installing nut or anything similar, which is what I was expecting to do.
However:
I have two PCs being protected by the same UPS, the second being a Win10 box. I was expecting to use something like nut to share the status between the two boxes so both will shut down on low battery.
Given that "it just works" so far, I'd like to supplement the existing config rather than replace it. Anyone here done something similar or know where I should start?
Mark
One of the "great" (for some value of great) thing about "It Just Works" is you (one) has no-idea how it works! I have apcupsd running = APC UPS Daemon. Minimal config & it works. You may or may not have that installed, or perhaps it's a hardware-driven USB driver thingy.
For apcupsd, I think there are examples posted on t'internet of how to use it to shut down multiple computers - either they all run apcupsd, or you hack the script that apcupsd runs in the power-fail-I'm-Shutting-down situation to send a message to the other machines to shutdown.
It may be possible to run apcupsd on a windows box (possibly via cygwin). Alternatively you have to run something that either listens to a signal from the UPS machine, or accepts commands from the UPS machine. You could run a SSH server on the windows machine that would accept a ssh command to shutdown (again, possibly via cygwin). (NB, first you have to work out how to issue a shutdown command from a command prompt). Alternatively, you could write a program that polls for the existence or non-existance of a file in a shared directory, and shuts down if it's there/not there. You'd then have to work out how to shutdown from inside a program.
I'm sure it's all been done before, but it could be fun working out how to do it. No doubt, windows' firewall will step in and make things more complicated.
I guess the first thing to would be to work out what software is initiating the shutdown on your UPS machine and read-up on it.
good luck!