Is it possible to shutdown multiple hosts from a single UPS?

I’m looking at getting a UPS, I’ve never used one before. I (think I) understand that they have a USB lead to signal to the host when the power fails. The one I’m looking at (APC Smart 1500, local on Marketplace) has a single USB connection and 8 C3 connectors, so I imagine I’ll plug a few things into it (NAS, Proxmox host etc), what I’m wondering is, is there any software out there that will relay that single “power failure” signal to other machines on the network?

What I’m imagining is something like a docker container running on the truenas box, with the USB passed through to it, the container receives the power failure signal and relays that to the truenas host, and a bunch of other hosts I configure.

Is that kinda thing possible? If not, what do you do with the other hosts plugged into the UPS?

You might be interested in the section titled “Can I attach Multiple Computers to One UPS?” in the following guide:

Here is one possible setup:

  • The device that is connected to the UPS acts as host running upsd
  • All devices that need to shutdown run the client upsmon

You don’t need a docker container as its already integrated in TrueNAS. TrueNAS can either be the host or the client, depending on how you configure it.

An alternative is that you can tell TrueNAS to use a custom shutdown script in the UPS settings. Maybe if you can’t run upsmon on all devices you could i.e. run ssh <machine> <appropriate-shutdown-command> in a script or something similar.

EDIT: Make sure to use the appropriate shutdown method for the target device (see comment of @HoneyBadger).

2 Likes

If you’re going to drive a scripted shutdown of TrueNAS remotely, please either use the remote API for system.shutdown or midclt call system.shutdown over SSH to give the middleware a chance to clean up.

Timestamp 14:34 if it doesn’t come through for some reason. :stuck_out_tongue:

1 Like