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

Teach nut-scanner to parallelize scans across many IP address ranges #2520

Merged
merged 28 commits into from
Jul 9, 2024

Conversation

jimklimov
Copy link
Member

Since work on issue #2244 began, nut-scanner learned to request scans for many individual IP addresses or ranges in one call. That was functional, but slow (as described in issue #2511) due to each range being scanned independently, until its timeout was hit.

This PR adds a way to iterate the IP address range collections, and extends the iterated multiple-IP methods for "Old NUT", SNMP, NetXML and IPMI (not parallelized yet!) to iterate not over a single set of start_ip .. end_ip but over all requested addresses in the same thread pool (per bus). For a small series of single-IP ranges this yields a very quick scan (not constrained by a sum of timeouts times the amount of such ranges).

…parate method [networkupstools#2244]

Allow for some shorter indentation

Signed-off-by: Jim Klimov <[email protected]>
…ict, NEWS.adoc: handle_arg_cidr(): add `-m auto*/ADDRLEN` mode [networkupstools#2244]

Signed-off-by: Jim Klimov <[email protected]>
… "arg_addr" [networkupstools#2244]

Avoid warning about clash with a global variable.
Fallout of refactoring original code into a method.

Also make it `const` as we do not change the original value anyway.

Signed-off-by: Jim Klimov <[email protected]>
… subnet by family before checking for mask length [networkupstools#2244]

Signed-off-by: Jim Klimov <[email protected]>
… before we declare vars and types

Signed-off-by: Jim Klimov <[email protected]>
… for ip_ranges[] list and helper metadata, and methods as part of libnutscan [networkupstools#2244, networkupstools#2511]

Not bumping library version, because it was recently bumped as
part of other PRs about this issue. Technically the scope of the
library has been changed by new exported methods and header lines.

Signed-off-by: Jim Klimov <[email protected]>
…t_ip<=irl.stop_ip in alphanumeric comparison order [networkupstools#2511]

Signed-off-by: Jim Klimov <[email protected]>
@jimklimov jimklimov added this to the 2.8.3 milestone Jul 9, 2024
@jimklimov jimklimov merged commit 3bfdb74 into networkupstools:master Jul 9, 2024
30 checks passed
@jimklimov jimklimov deleted the issue-2511 branch July 9, 2024 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant