Teach nut-scanner to handle several IP address ranges#2509
Teach nut-scanner to handle several IP address ranges#2509jimklimov merged 17 commits intonetworkupstools:masterfrom
nut-scanner to handle several IP address ranges#2509Conversation
…}: report the IP address (range, single, none) in the log [networkupstools#2244] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…pstools#2244] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…roper support [networkupstools#2244] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ions [networkupstools#2244] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… options and others behave differently without them [networkupstools#2244] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… introduce a way to scan several IP address ranges [networkupstools#2244] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…on-threaded scans too [networkupstools#2244] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ice() from adding a list to itself Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…etworkupstools#2244] We actually use DEFAULT_NETWORK_TIMEOUT from common.h same as in clients/upsclient.c Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
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 <jimklimov+nut@gmail.com>
…ymbols in libnutscan to use them in nut-scanner [networkupstools#2244] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…networkupstools#2244] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… and logged reports to help troubleshooting [networkupstools#2244] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… in the name, and use static structs and memcpy() to actually fix alignment warnings [networkupstools#2244] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…n-/semi-valid inputs [networkupstools#2244] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… actually fix alignment warnings Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
|
Ultimately, separating the |
|
✅ Build nut 2.8.2.1878-master completed (commit 611e8ba4fa by @jimklimov) |
Now the
-m cidrand-s/-eoption 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 autowhich 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.