Connect a UPS to your Korthveil firewall and let it shut everything down in the right order when the power fails and the battery cannot last: first the machines that watch the UPS themselves (NUT clients), then the servers you choose (over SSH, in waves), and the firewall itself last. The UPS then switches its output off and on again when mains returns, so the firewall and your servers come back by themselves. The screenshots are from a test firewall with a simulated UPS; the example is a home rack with a NAS, a hypervisor and a few PCs.
The example:
| UPS | A USB UPS on the firewall's USB port, about 12 minutes of runtime at the usual load |
| Firewall | korthmain, LAN 192.168.2.4 |
| Hypervisor | xcp-ng, 192.168.2.30: runs its own NUT client pointed at the firewall |
| NAS | nas, 192.168.2.20: shut down over SSH |
| PCs | office-pc, media-pc: shut down over SSH, after the NAS |
When does the shutdown start? Only while the UPS is on battery, and as soon as one of these holds:
If mains returns before that, nothing is shut down: the outage is only logged. With less than 5 minutes of runtime, these defaults start the shutdown one minute after the power fails, or earlier when the runtime estimate drops below 3 minutes.
A failover pair (see Two firewalls with automatic failover): each firewall has its own UPS and its own settings. The standby shuts down after 30 seconds on battery to save its battery; the active firewall keeps your internet until its own triggers fire. When mains returns, the standby comes back and rejoins the pair.
name@host, for example ups@192.168.2.5.
After the commit, Status shows the UPS: On line, the charge, the runtime left at the current load, the load, and the input and output voltage. The three graphs (charge, runtime, load) fill in as the firewall measures; you can add them to the dashboard with Layout › Add from other pages › UPS & power.

Under When to shut down, keep the defaults or change them:
The line below the settings shows how long the whole shutdown can take. If it warns that the shutdown does not fit in the runtime, raise Runtime left, shorten On battery for, or lower the machines' budgets (Step 5).

Press Save and commit.
Machines that can run a NUT client (upsmon) shut down by themselves when the firewall tells them to: Linux servers, Proxmox, XCP-ng, Synology and QNAP NAS units, and Windows with a NUT client. Nothing is stored on the firewall for them.
monuser or type another, and enter a password for the clients. It is stored as a secret and never shown again.On each machine, point its NUT client at the firewall. On Linux, in upsmon.conf:
MONITOR ups@192.168.2.4 1 monuser <password> secondary
On Synology: Control Panel › Hardware & Power › UPS, Synology UPS server off, Network UPS server 192.168.2.4.
Back on the page, the machine is listed under Connected now.

NUT sends the password in the clear, so keep the clients on a trusted network.
A UPS usually has one USB data port, so only one firewall can be connected to it by cable. The other firewall watches the same UPS over the network. In the example, the USB cable goes to korthmain (192.168.2.4) and the NUC watches korthmain's UPS.
On korthmain (the firewall with the USB cable):
On the NUC (no cable):
ups@192.168.2.4. Use korthmain's own address, not the shared gateway 192.168.2.1: after a failover the shared address is on the NUC itself, and it would then watch itself.
What happens in an outage:
Each firewall keeps its own UPS & power settings: the configuration sync never copies them to the other.
For machines without a NUT client, the firewall logs in over SSH and runs their shutdown command.
Pick them from the network: under Machines to shut down, press Add from network. The firewall lists the machines its DHCP server knows (leases and reservations, with name, address and MAC). Tick the ones on this UPS and press Add.

Or add one by hand: press Add by hand and type the name and address (an IP address or a host name), and the MAC if you want Wake-on-LAN.
Then open each machine and fill in:
sudo -n shutdown -h now by default. On Windows with OpenSSH: shutdown /s /t 0. On Linux, allow the user to run it without a password, for example in /etc/sudoers.d/korthveil: korthveil-shutdown ALL=(root) NOPASSWD: /usr/sbin/shutdown.
Press Save and commit, then press Test connection on each SSH machine. The firewall logs in and runs nothing; the first login pins the machine's host key, and a later login with a different key is refused. If you reinstall a machine, press Forget host key and test again.
Waves, for many machines: give machines a wave and list the waves in order under Wave order, for example VMs, hosts, storage: virtual machines first, then the hypervisors, then the NAS that stores them. The machines of one wave shut down at the same time (up to 32 at once); the next wave starts when every machine of the wave has stopped answering, or its budget (120 seconds by default) has passed. The firewall goes last.
Wake-on-LAN: under Wake-on-LAN after mains is back for, enter for example 120 seconds. After a real shutdown, once mains has been back that long, the firewall wakes the machines you ticked.
Under Test shutdown (no power-off), press Test shutdown. Korthveil goes through the whole sequence and logs every step without carrying any out:

Fix whatever the log marks note (a machine that does not answer, a UPS that cannot restore its output), then test again. Do a real test with your UPS at a time you choose: unplug the UPS from the wall and watch the events.
The step log of the last real shutdown stays on the page under Last real shutdown, and every event is in Events.