The Wanderer <wande...@fastmail.fm> writes: > On 12/10/2014 at 10:12 AM, Darac Marjal wrote: > >> On Wed, Dec 10, 2014 at 09:42:43AM -0500, The Wanderer wrote: >> >>> On 12/10/2014 at 06:10 AM, Andrei POPESCU wrote: > >>>> That would be easy to implement, assuming you computer "knows" >>>> it's running on batteries. >>> >>> On batteries is easy enough, for a laptop-style system. >>> >>> But for a more ordinary desktop (or server), running on a UPS, how >>> is it supposed to know that it is on battery-based power? >>> >>> It's plugged in through an ordinary power cable, with no other >>> connection to the power source. What indication is it supposed to >>> have that the power source at the other end of that cable is any >>> different from a standard wall outlet? >>> >>> I imagine that this might be one of the things the "USB cable from >>> the UPS" is intended to address, but I don't think my own UPS (for >>> example) includes any USB port, despite being a fairly high-end >>> unit. (And off the top of my head I don't know of any software to >>> handle that in Debian.) >> >> NUT and APCUPSd are the most obvious solution > > Yeah, I figured there would be software for the purpose which I didn't > specifically know about. > > At a glance, however, both of those look like they still require a USB > connection... and my (APC) UPS doesn't seem to have a USB port. It does > have a network port, so I imagine that maybe I could get things working > with a network cable to the house switch, but that seems like a clunky > and unwieldy sort of solution at best.
Another way out is to put one host out of UPS coverage, and periodically poll the liveness of that host. If the host on UPS is alive, but the other is not, you're probably on batteries. I've hacked together such solutions in the past when I didn't have a capable enough UPS. You have to arrange things so the canary host is ok with abrupt halts and does power back up when power returns. I guess, these days, a raspberry pi would do the job nicely. -- regards, kushal -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/877fxzs8sl....@mercury.locationd.net