Skip to content

nut-scanner network scans should provide a "-m auto" option #2244

Closed

Description

@aquette

when scanning network devices (SNMP, XML, NUT), nut-scanner should provide a "-m auto" option to automatically provide the local network information.

Example: when your IP is 192.168.1.1 on a class C network, "-m auto" should be equivalent to "-m 192.168.1.1/24"

Activity

  1. jimklimov commented on Dec 22, 2023

    @jimklimov
    Member

    I think this logic could be already done in 42ity fork? port-back is still piecemeal and pending for the bigger features (for diligent separated reviewability and bug dissection).

  2. aquette commented on Dec 22, 2023

    @aquette
    MemberAuthor

    I told myself the same 42ITy, but not sure. IIRC, it's uses libcidr and I don't want such deps.

    For now, in HA SmartNUT add-on, found a clean workaround ;) (bashio returns exactly what is expected)
    https://github.com/aquette/addon-smartnut/blob/main/smartnut/rootfs/etc/cont-init.d/smartnut.sh#L89

  3. jimklimov commented on Jan 20, 2024

    @jimklimov
    Member

    BTW, what is wrong with libcidr? :) Not that it's hard to parse a few string patterns and do bit maths ourselves...

  4. jimklimov commented on Jul 1, 2024

    @jimklimov
    Member

    FWIW, I've recently had another pass at porting stuff from the FTY fork and checking the remaining differences (by now two big things are packaging recipes and DMF, and also docs/nut-names.txt, see #1316 for the detailed list of that effort).

    There were no mentions of libcidr there, and no different code about CIDR handling, so I actually looked deeper and found nutscan-ip.c which does the related magic (including CIDR conversion to a start/end IP address pair) since your and Frederic's time. I guess we dealt with libcidr elsewhere in the 42ITy project, in some other components.

    So here your issue is indeed new and pristine after all, with the challenging part being about portably detecting what non-loopback IP address(es) we have at disposal on the current system, with what netmasks, and checking perhaps all of the resulting ranges (if there's more than one).

  5. added this to the 2.8.4 milestone on Jul 4, 2024
  6. 76 remaining items

  7. modified the milestones: 2.8.4, 2.8.3 on Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    SmartNUTMulti-backend extension of NUT for smart home integrationsnut-scanner

    Type

    No type

    Projects

    • Status
      Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions