Skip to content

luci-app-nut: fix sync between LuCI and init.d parameters#8420

Closed
usamanassir wants to merge 1 commit intoopenwrt:masterfrom
usamanassir:fix-nut-monitor-sync
Closed

luci-app-nut: fix sync between LuCI and init.d parameters#8420
usamanassir wants to merge 1 commit intoopenwrt:masterfrom
usamanassir:fix-nut-monitor-sync

Conversation

@usamanassir
Copy link
Copy Markdown

@usamanassir usamanassir commented Mar 15, 2026

  • This PR is not from my main or master branch 💩, but a separate branch ✅
  • Each commit has a valid ✒️ Signed-off-by: <my@email.address> row (via git commit --signoff)
  • Each commit and PR title has a valid 📝 <package name>: title first line subject for packages
  • Incremented 🆙 any PKG_VERSION in the Makefile
  • Tested on: (architecture, openwrt version, browser) ✅
  • ( Preferred ) Mention: @ the original code author for feedback
  • ( Preferred ) Screenshot or mp4 of changes:
  • ( Optional ) Closes: e.g. openwrt/luci#issue-number
  • ( Optional ) Depends on: e.g. openwrt/packages#pr-number in sister repo
  • Description: (describe the changes proposed in this PR)

Signed-off-by: Usama Nassir <usama.nassir@gmail.com>
@github-actions
Copy link
Copy Markdown

Warning

Some formality checks failed.

Consider (re)reading submissions guidelines.

Failed checks

Issues marked with an ❌ are failing checks.

Commit fe3bff6

  • 🔶 Commit subject length: recommended max 50, required max 60 characters
  • ❌ Commit message is missing. Please describe your changes.

For more details, see the full job log.

Something broken? Consider providing feedback.

@systemcrash
Copy link
Copy Markdown
Contributor

@danielfdickinson does this agree?

@danielfdickinson
Copy link
Copy Markdown
Contributor

I think part of the problem may be incorrect values in the https://github.com/openwrt/packages version of nut. I would prefer to see a PR ensuring packages.git is correct before updating LuCI to match it. I've been rather busy, but if I am able to find some time, I will such a PR myself.

@usamanassir
Copy link
Copy Markdown
Author

@danielfdickinson, I simply matched the names to https://github.com/openwrt/packages/blob/master/net/nut/files/nut-monitor.init.
If you think it is better, I can change nut-monitor.init instead. important thing is to get both of them using that same names.

danielfdickinson added a commit to danielfdickinson/packages that referenced this pull request Mar 17, 2026
Prompted by openwrt/luci#8420 (comment)
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 upsream documenation that
are not currently present in the UCI configs.

Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
danielfdickinson added a commit to danielfdickinson/packages that referenced this pull request Mar 17, 2026
Prompted by openwrt/luci#8420 (comment)
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.

Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
danielfdickinson added a commit to danielfdickinson/packages that referenced this pull request Mar 17, 2026
Prompted by openwrt/luci#8420 (comment)
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.

Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
danielfdickinson added a commit to danielfdickinson/packages that referenced this pull request Mar 17, 2026
Prompted by openwrt/luci#8420 (comment)
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.

Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
@danielfdickinson
Copy link
Copy Markdown
Contributor

@usamanassir I have created openwrt/packages#28875 which makes sure the names are correct from NUTs point of view. This PR should match that PR.

I have also created #8434 to keep that part in sync.

@usamanassir
Copy link
Copy Markdown
Author

@danielfdickinson, wont (openwrt/packages#28875 break old nut instlattions. Meaning, once a working system gets the new version, it will stop working.

@danielfdickinson
Copy link
Copy Markdown
Contributor

@danielfdickinson, wont (openwrt/packages#28875 break old nut instlattions. Meaning, once a working system gets the new version, it will stop working.

Care was taken to prevent breaking old installations. Have you actually tried? If you have an installation that breaks, please provide configuration and logs of the broken configuration. Also please provide those comments on openwrt/packages#28875

danielfdickinson added a commit to danielfdickinson/packages that referenced this pull request Apr 6, 2026
Prompted by
openwrt/luci#8420 (comment)
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
openwrt#28875 (comment)
we simplify the configuration and add checks to avoid bad configs
due to misspellings/typos of configuation options by users.

Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
danielfdickinson added a commit to danielfdickinson/packages that referenced this pull request Apr 6, 2026
Prompted by
openwrt/luci#8420 (comment)
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
openwrt#28875 (comment)
we simplify the configuration and add checks to avoid bad configs
due to misspellings/typos of configuation options by users.

Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
danielfdickinson added a commit to danielfdickinson/packages that referenced this pull request Apr 6, 2026
Prompted by
openwrt/luci#8420 (comment)
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
openwrt#28875 (comment)
we simplify the configuration and add checks to avoid bad configs
due to misspellings/typos of configuation options by users.

Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
danielfdickinson added a commit to danielfdickinson/packages that referenced this pull request Apr 6, 2026
Prompted by
openwrt/luci#8420 (comment)
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
openwrt#28875 (comment)
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>
danielfdickinson added a commit to danielfdickinson/luci that referenced this pull request Apr 7, 2026
openwrt/packages#28875 deals with
openwrt#8420 (comment)
and
openwrt/packages#28875 (comment)

by simplifying the configuration of notification messages and flags.

At the same time it modernizes the monitoring user configuration.

Supersedes openwrt#8434

This commit syncs luci-app-nut for the nut package changes in
openwrt/packages#28875 .

Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
@danielfdickinson
Copy link
Copy Markdown
Contributor

@usamanassir I believe #8533 and the related openwrt/packages#28875 resolve the parameters names issue.

@usamanassir
Copy link
Copy Markdown
Author

Agree. Closing the PR.

@usamanassir usamanassir closed this Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants