-
-
Notifications
You must be signed in to change notification settings - Fork 351
Ensure UPS settings with volatile device memory
Many devices accept settings over their protocol, although some of those only remember them until a power cycle.
In this case it is useful to have their NUT "primary" server re-write the settings whenever it starts.
Note that per discussions in e.g. issue #1993 currently (as of NUT v2.8.0 or earlier, as of this writing) an ups.conf
section attribute to override.something
sets a driver-known value but does not propagate it actually to the device when a driver starts.
Adapted from https://github.com/networkupstools/nut/issues/1993#issuecomment-1655232161 :
My work around: Make a script which are called from a systemd-timer unit at boot (and every 24 hours just in case).
Systemd-timer example:
Timer-file (/etc/systemd/system/nut_properties.timer):
[Unit]
Description="Set nut startup-properties"
[Timer]
OnBootSec=1min
OnUnitActiveSec=24h
[Install]
WantedBy=timers.target
Service-file (/etc/systemd/system/nut_properties.service)
[Unit]
Description="Set nut startup properties"
[Service]
Type=oneshot
ExecStart=/etc/nut/CustomStartupProperties.sh
Script-file: /etc/nut/CustomStartupProperties.sh
:; upsrw -w -s battery.charge.low=50 -u nut -p MyPass eaton@localhost
:; upsrw -w -s ups.delay.shutdown=120 -u nut -p MyPass eaton@localhost
:; upsrw -w -s ups.delay.start=125 -u nut -p MyPass eaton@localhost
The -w
parameter is very important when you call multiple upsrw
commands
Set permissions on the script-file:
:; chmod u=rwx,g=rwx,o=--- /etc/nut/CustomStartupProperties.sh
Welcome to the Network UPS Tools (NUT) project Wiki, and feel free to contribute tricks and insights.
While there are several good entries in the menu, ones referenced most frequently in issue discussions include:
- Building NUT for in-place upgrades or non-disruptive tests and Using NIT (NUT Integration Test suite) sandbox
- Technicalities: Customizing (NUT) config files and scripts delivered by packaging
- Links to distribution packaging recipes and repository sections
- Troubleshooting
upsdrvctl
drivers not starting ("insufficient permissions on everything" or "Can't claim USB device [VVVV:PPPP]@0/0: Entity not found") possibly due to nut-driver-enumerator (NDE) services having been there before you with NUT 2.8.x - Changing NUT daemon debug verbosity
- Building NUT integration for Home Assistant
- Running NUT in an LXC container
- Troubleshooting eventual disconnections (Data stale) and CyberPower Systems (CPS) know-how
- NUT for Windows
- NUT HCL and DDL
- Code contributions, PRs, PGP and DCO
- NUT CI farm
Also keep in mind the documentation links from NUT website and the FAQ in particular.