mirror of
https://github.com/openwrt/packages.git
synced 2026-05-31 06:51:51 +08:00
0c88118ad4
Prompted by https://github.com/openwrt/luci/pull/8420#issuecomment-4071252681 we update upsmon configs to ensure they are correct according to upstream. We reorder the options so that they match upstream documentation at <https://networkupstools.org/docs/man/upsmon.conf.html> to be sure we have not missed any items. While at it, we add configuration options from the upstream documentation that are not currently present in the UCI configs. Some years ago upstream changed the names the primary/secondary UPS system/monitor from master/slave to primary/secondary. It is uncertain how much longer these deprecated names will be accepted by NUT. Therefore update naming to match upstream documentation and configuration. See <https://networkupstools.org/docs/man/upsmon.html>, <https://networkupstools.org/docs/man/upsmon.conf.html>, and <https://networkupstools.org/docs/man/upsd.users.html>. At the same time, prompted by https://github.com/openwrt/packages/pull/28875#issuecomment-4079307540 we simplify the configuration and add checks to avoid bad configs due to misspellings/typos of configuation options by users. A sample config config upsmon 'upsmon' option notifycmd '/usr/bin/logger -t nut-monitor-exec ' config monitor option type primary option upsname upsname option hostname localhost option username upsuser option password upspassword config notifications 'ONLINE' option message "UPS %s is on line power" option flag "SYSLOG" config notifications 'ONBATT' option message "UPS %s is on battery power" option flag "SYSLOG+EXEC" In order to iterate through the notifications, we use named 'notifications' sections and compare the section name to list of notification events defined by NUT. If they don't match, warn during initscript startup. Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
27 lines
612 B
Plaintext
27 lines
612 B
Plaintext
#config driver_global 'driver_global'
|
|
# option user nut
|
|
|
|
#config driver 'upsname'
|
|
# option driver usbhid-ups
|
|
# option port auto
|
|
# option enable_usb_serial 0
|
|
|
|
#config user
|
|
# option username upsuser
|
|
# option password upspassword
|
|
# option actions optional-action
|
|
# list instcmd optional-instant-command
|
|
# option upsmon secondary|primary
|
|
|
|
#config listen_address
|
|
# option address ::1
|
|
# option port 3493
|
|
|
|
#config upsd 'upsd'
|
|
# option maxage 15
|
|
# option statepath /var/run/nut
|
|
# option maxconn 1024
|
|
# option runas nut
|
|
# NB: certificates only apply to SSL-enabled version
|
|
# option certfile /usr/local/etc/upsd.pem
|