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: report bogus and duplicate serial numbers #1811

Merged
merged 6 commits into from
Jan 15, 2023

Conversation

jimklimov
Copy link
Member

@jimklimov jimklimov commented Jan 14, 2023

Closes: #1810

UPDATE: Currently addresses sanity-checking for one media type (e.g. SNMP and USB separately), not across multiple discoveries (follow-up in #1813)

Example sanity-checked suggested configuration:

[nutdev1]
        driver = "usbhid-ups"
        port = "auto"
        vendorid = "0463"
        productid = "FFFF"
        product = "Ellipse ECO"
        serial = "000000000"
        vendor = "EATON"
        bus = "003"
        device = "002"
        ###NOTMATCHED-YET###bcdDevice = "0100"

# WARNING: all-same character "serial" with 9 copies of '0' (0x30) reported in some devices: nutdev1

...same with logs bumped:

  15.048347     [D1] SCANS DONE: display results: USB
  15.048351     [D2] nutscan_display_ups_conf_with_sanity_check: USB
  15.048369     [D2] nutscan_display_ups_conf: USB
[nutdev1]
        driver = "usbhid-ups"
        port = "auto"
        vendorid = "0463"
        productid = "FFFF"
        product = "Ellipse ECO"
        serial = "000000000"
        vendor = "EATON"
        bus = "003"
        device = "002"
        ###NOTMATCHED-YET###bcdDevice = "0100"
  15.048398     [D2] nutscan_display_sanity_check: USB
  15.048403     [D2] nutscan_display_sanity_check_serial: USB
  15.048408     [D3] nutscan_display_sanity_check_serial: checking serial numbers for 1 device configuration(s)
  15.048412     [D3] nutscan_display_sanity_check_serial: new entry for serial '000000000'

# WARNING: all-same character "serial" with 9 copies of '0' (0x30) reported in some devices: nutdev2
  15.048419     [D1] SCANS DONE: free resources: USB

@jimklimov jimklimov added enhancement documentation nut-scanner USB-duplicate-devices Track bugs and issues about monitoring several devices that seem identical to NUT or libusb labels Jan 14, 2023
@jimklimov jimklimov added this to the 2.8.1 milestone Jan 14, 2023
@AppVeyorBot
Copy link

@AppVeyorBot
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation enhancement nut-scanner USB-duplicate-devices Track bugs and issues about monitoring several devices that seem identical to NUT or libusb
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nut-scanner should emit warning for bogus (all-zero) or duplicate serials
2 participants