-
-
Notifications
You must be signed in to change notification settings - Fork 350
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
Teach nut-scanner
to handle several IP address ranges
#2509
Conversation
…}: report the IP address (range, single, none) in the log [networkupstools#2244] Signed-off-by: Jim Klimov <[email protected]>
…pstools#2244] Signed-off-by: Jim Klimov <[email protected]>
…roper support [networkupstools#2244] Signed-off-by: Jim Klimov <[email protected]>
…ions [networkupstools#2244] Signed-off-by: Jim Klimov <[email protected]>
Signed-off-by: Jim Klimov <[email protected]>
… options and others behave differently without them [networkupstools#2244] Signed-off-by: Jim Klimov <[email protected]>
… introduce a way to scan several IP address ranges [networkupstools#2244] Signed-off-by: Jim Klimov <[email protected]>
…on-threaded scans too [networkupstools#2244] Signed-off-by: Jim Klimov <[email protected]>
…ice() from adding a list to itself Signed-off-by: Jim Klimov <[email protected]>
…etworkupstools#2244] We actually use DEFAULT_NETWORK_TIMEOUT from common.h same as in clients/upsclient.c Signed-off-by: Jim Klimov <[email protected]>
a4cbceb
to
c267ed1
Compare
In a recent commit, added the code to The final code would go beyond this PoC reporting of course; the primary goal of this push is to see how many platforms would complain about unknown methods and data types :) Like hitting https://stackoverflow.com/questions/35551879/cast-from-sockaddr-to-sockaddr-in-increases-required-alignment ... |
❌ Build nut 2.8.2.1877-master failed (commit d54d893da2 by @jimklimov) |
From messages seen so far, the code is more portable than I expected, at least across POSIX systems.
Build scenarios are still running, so maybe something else would crop up. But I can start addressing these already, to leave fewer raised alarms in the next iteration... |
Log from a test run, about parsing different addresses (e.g.
|
Added
Need to chop off |
Aha, not a big deal: |
@aquette : link-local addresses (unicast ones like https://en.wikipedia.org/wiki/Link-local_address Unfortunately, there does not seem to be a portable flag for those, e.g. https://man7.org/linux/man-pages/man7/netdevice.7.html -- any ideas? |
…scans do not parallelize together [networkupstools#2244] See also: networkupstools#2511 Signed-off-by: Jim Klimov <[email protected]>
…ymbols in libnutscan to use them in nut-scanner [networkupstools#2244] Signed-off-by: Jim Klimov <[email protected]>
…networkupstools#2244] Signed-off-by: Jim Klimov <[email protected]>
… and logged reports to help troubleshooting [networkupstools#2244] Signed-off-by: Jim Klimov <[email protected]>
… in the name, and use static structs and memcpy() to actually fix alignment warnings [networkupstools#2244] Signed-off-by: Jim Klimov <[email protected]>
…n-/semi-valid inputs [networkupstools#2244] Signed-off-by: Jim Klimov <[email protected]>
… actually fix alignment warnings Signed-off-by: Jim Klimov <[email protected]>
Ultimately, separating the |
✅ Build nut 2.8.2.1878-master completed (commit 611e8ba4fa by @jimklimov) |
Now the
-m cidr
and-s
/-e
option groups can be repeated on command line, and cause several IP address ranges to be scanned for SNMP, NetXML, IPMI and old NUT buses.Preparation for #2244 (
-m auto
which would likely find several connected subnets on a typical server). That step would likely need something like:Also may need better support for CIDR netmasks (not bit counts), and larger masks for IPv6.
Review and practical testing in an environment with many devices to see would be welcome.