From 992e20a24ccfe6e4714420813aeaac1b9e1393db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20H=C3=B6fling?= Date: Tue, 17 Nov 2026 00:38:08 +0100 Subject: [PATCH] omv-usbhid: NUT unter OpenMediaVault 6, Plugin-Fehler und Reparatur Co-Authored-By: Claude Opus 5.5 --- README.md | 7 +++++ omv-usbhid/README.md | 71 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 omv-usbhid/README.md diff --git a/README.md b/README.md index c2eac59..5f3c15e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,9 @@ # nut-ups +NUT (Network UPS Tools) setups. + +| Folder | Use | +|---|---| +| `bluewalker-vfi-icr/` | PowerWalker VFI ICR IoT, plain Debian, master + network clients | +| `omv-usbhid/` | OpenMediaVault 6 with the openmediavault-nut plugin (USB HID UPS, e.g. Eaton), plugin bugs and fix | + diff --git a/omv-usbhid/README.md b/omv-usbhid/README.md new file mode 100644 index 0000000..128140c --- /dev/null +++ b/omv-usbhid/README.md @@ -0,0 +1,71 @@ +# NUT on OpenMediaVault 6 (openmediavault-nut plugin) + +For hosts where NUT is managed by the OMV plugin `openmediavault-nut` +(6.0.x, NUT 2.7.4 on Debian 11). Do **not** use the install scripts from +`bluewalker-vfi-icr/` here: OMV regenerates `/etc/nut/*` on every deploy and +overwrites hand-made files. + +First deployment: DaKa NAS (80005), Eaton 3S 550 via USB (`usbhid-ups`, +subdriver `MGE HID`), standalone mode. Host notes in +`it-wartung/hosts/80005-nas.md`. + +## Settings in the OMV web UI + +Services -> UPS: enable, mode `standalone`, identifier `ups`, +driver config: + +``` +driver = usbhid-ups +port = auto +``` + +Shutdown mode `onbatt`, timer 300 s (shut down after 5 minutes on battery, +LOWBATT shuts down earlier anyway). + +## Plugin bugs and the fix + +1. **Random passwords break upsmon.** Without an override the plugin + generates the `monmaster`/`admin` passwords with `random.get_str(16)`, + which includes `#` and `'`. NUT 2.7.4 treats `#` as a comment, the + `MONITOR` line loses fields and `nut-monitor` dies with + "Unable to use old-style MONITOR line without a username". Every save in + the web UI rolls the dice again. +2. **DEADTIME 555.** The template multiplies the string `'5'` by 3. + +Fix: fixed alphanumeric values in `/etc/default/openmediavault`, then +rebuild the pillar and deploy: + +``` +gen(){ tr -dc A-Za-z0-9 > /etc/default/openmediavault +echo "OMV_NUT_UPSDUSERS_ADMIN_PASSWORD=\"$(gen)\"" >> /etc/default/openmediavault +echo 'OMV_NUT_UPSMON_DEADTIME="15"' >> /etc/default/openmediavault +omv-salt stage run prepare # rewrites /srv/pillar/omv/default.sls +omv-salt deploy run nut +``` + +`omv-salt stage run prepare` is required: the pillar file is only rebuilt +by that stage, `deploy run` alone keeps the old values and the plugin +silently falls back to a new random password. + +## Check + +``` +systemctl is-active nut-driver nut-server nut-monitor # 3x active +upsc -c ups@localhost # lists 127.0.0.1 = upsmon is logged in +upsc ups@localhost ups.status # OL = on line +grep -E '^(MONITOR|DEADTIME)' /etc/nut/upsmon.conf +``` + +PID-file warnings from `nut-monitor` ("Can't open PID file ... Operation +not permitted") are cosmetic on Debian's NUT 2.7.4. + +## Behaviour on power loss + +- ONBATT -> upssched timer 300 s -> `upsmon -c fsd` -> shutdown. +- `/lib/systemd/system-shutdown/nutshutdown` tells the UPS to cut output + after `ups.delay.shutdown` (20 s) and to restart it when mains returns. +- Whether the host then boots again depends on the BIOS/BMC power-restore + policy (`ipmitool chassis status`). For a host that should stay off, + set it to `always-off`. +- No mail notification unless OMV mail notification is configured.