Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nut-scanner: Fix "Old NUT" detection and clarify some log messages #2449

Merged
merged 4 commits into from
May 18, 2024

Conversation

jimklimov
Copy link
Member

@jimklimov jimklimov commented May 18, 2024

It seems that commit 3eb96fe (PR #2246 for issue #2242) released in NUT v2.8.2 broke detection that libupsclient.so is not available (not a really practical situation breaking end-user setups, outside of some weird packaging choices on constrained systems, or builds on systems where NUT is not installed into common paths - it did fire up in test cases investigated for another issue #2431).

Also this PR takes a moment to clarify what "old nut" is about in nut-scanner context (as opposed to "new" avahi-based detection where available) so help() and codebase reading is more comprehensible.

Finally, this PR changes all flags about detected scanning methods to be zeroed initially, only set to 1 (even if always) in the nutscan_init() method, to be consistent.

… "Old NUT" method available [fallout of networkupstools#2246]

If `libupsclient.so` was not loaded, we can not really use this search.
Seems like a copy-paste problem mis-adding the NUT Simulation support.

Signed-off-by: Jim Klimov <[email protected]>
…TH_SNMP_STATIC in nutscan_init()

...and let debug log know we skipped the library search, and why.

Signed-off-by: Jim Klimov <[email protected]>
… avahi detection in messages/help

Signed-off-by: Jim Klimov <[email protected]>
…s not requested "or supported"

Signed-off-by: Jim Klimov <[email protected]>
@jimklimov jimklimov added bug enhancement nut-scanner impacts-release-2.8.2 Issues reported against NUT release 2.8.2 (maybe vanilla or with minor packaging tweaks) labels May 18, 2024
@jimklimov jimklimov added this to the 2.8.3 milestone May 18, 2024
@jimklimov jimklimov requested a review from aquette May 18, 2024 10:17
@jimklimov jimklimov added this to In Progress in SmartNUT via automation May 18, 2024
jimklimov referenced this pull request May 18, 2024
* nut-scanner: detect and configure NUT simlation devices

Provide an additional nut-scanner "-n | --nut_simulation_scan"
option to detect and configure dummy simulation (.dev & .seq)
from the default $sysconfdir.

Also advertise NUT Simulation Devices in HCL.

This should standardize and streamline the use of nut-scanner
as an automatic detection and configuration tool.

Closes: #/issues/2242

Signed-off-by: Arnaud Quette <[email protected]>
Copy link
Member

@aquette aquette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch @jimklimov !

@jimklimov jimklimov merged commit 9f8dc40 into networkupstools:master May 18, 2024
30 checks passed
SmartNUT automation moved this from In Progress to Done May 18, 2024
@jimklimov jimklimov deleted the issue-2246 branch May 18, 2024 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug enhancement impacts-release-2.8.2 Issues reported against NUT release 2.8.2 (maybe vanilla or with minor packaging tweaks) nut-scanner
Projects
SmartNUT
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants