[Nut-upsuser] [Announcement] Python3 scripts to replace upsmon, upssched, upssched-cmd
roger at rogerprice.org
Sat Oct 24 19:52:49 BST 2020
I have been experimenting with a Python3 re-implementation of upsmon,
upssched and upssched-cmd. This is currently in use on openSUSE and
Debian boxes. It provides a much richer "language" for UPS management.
For example, the key part of the well known "warn on [OB], shutdown on
[LB]" approach is written as
# Warnings when on-battery, wait for low battery
LET Msg-OB = banner " Power failure, possible shutdown, save your work ..."
LET Msg-shutdown = banner " On battery, shutting down now ..."
WHEN [UPS] REPORTS OL->OB : NOTIFY Msg-OB NUTLOG Msg-OB WALL Msg-OB
# Shutdown on low battery
WHEN Eaton REPORTS None->LB : NOTIFY Msg-shutdown NUTLOG Msg-shutdown
WALL Msg-shutdown STARTTIMER final-delay 5
WHEN Eaton TIMEOUT final-delay : SHUTDOWNCMD "/sbin/shutdown -h 0"
All communication with upsd is TLS encrypted. The status is
"experimental", intended for experiment and demonstration. The scripts
and documentation are available at http://rogerprice.org/NUT/ . The
file ConfigExamples.A5.pdf is extended with a new Part 2 covering the
If you are curious, I have put my timed shutdown at the end of this message
Since UPSmon.py requires the latest TLS, upsd needs help. This help is
provided by daemon upsdTLS.py which runs alongside upsd providing TLS
The certificates required for current TLS are more restrictive. Script
mkNUTcert.py generates private and public certificates suitable for
This script generates "standard" and timed shutdown configuration
files for UPSmon.py.
Comments welcome in this list. I will write separately with a
detailed description of the differences between upsmon and UPSmon.py.
More information about the Nut-upsuser