What I just tagged
I just tagged v0.4.0 of ups-orchestrator! It turns Network UPS Tools (NUT) events into Discord embeds, one per UPS. You get messages for on battery, countdown, power restored, low battery and comms lost. It can also shut machines down when the battery crosses a threshold. The code is at https://github.com/kleinpanic/ups-orchestrator.
It works with any number of UPS units. I wrote it for a homelab with two CyberPower units. It has zero runtime dependencies.
How it works
NUT's upsmon fires events to upssched. upssched calls a script, which runs ups-orchestrator with the event and the UPS name. The embed goes out through the Python standard library, and it honours the retry_after on an HTTP 429.
A systemd user service runs ups-orchestrator watch. It polls for shutdown thresholds. Each UPS has its own list of shutdown targets. The local host always shuts down last.
What is new in v0.4.0
- a serial shutdown target, which still works when the network is down
- SSH host aliases from ssh_config
- a release-on-tag workflow
- docs synced to the GitHub wiki at https://github.com/kleinpanic/ups-orchestrator/wiki
It targets Python 3.11 to 3.13 with mypy strict and ruff.
Install
Run deploy/install.sh as root, then add your webhook to the env file it sets up. Apply the NUT snippets and restart nut-server and nut-monitor. For the user service, run this first:
loginctl enable-linger "$USER"
Then run deploy/install-user-service.sh. The README has the full steps.
What is not done
This is the only tag. The CHANGELOG also lists 0.2.0 and 0.3.0. All three came from one evening, about three and a half hours after the first commit.
P.S Thanks for reading. Consider subbing to the RSS feed.
Klein Panic