check discover_no_type and friends earlier on in neighbors list build
This commit is contained in:
@@ -45,7 +45,7 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub {
|
|||||||
# only enqueue if device is not already discovered,
|
# only enqueue if device is not already discovered,
|
||||||
# discover_* config permits the discovery
|
# discover_* config permits the discovery
|
||||||
foreach my $neighbor (@to_discover) {
|
foreach my $neighbor (@to_discover) {
|
||||||
my ($ip, $remote_type, $remote_id) = @$neighbor;
|
my ($ip, $remote_id) = @$neighbor;
|
||||||
if ($seen_ip{ $ip }++) {
|
if ($seen_ip{ $ip }++) {
|
||||||
debug sprintf
|
debug sprintf
|
||||||
' queue - skip: IP %s is already queued from %s',
|
' queue - skip: IP %s is already queued from %s',
|
||||||
@@ -63,13 +63,6 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub {
|
|||||||
my $newdev = get_device($ip);
|
my $newdev = get_device($ip);
|
||||||
next if $newdev->in_storage;
|
next if $newdev->in_storage;
|
||||||
|
|
||||||
if (not is_discoverable($newdev, $remote_type)) {
|
|
||||||
debug sprintf
|
|
||||||
' queue - skip: %s of type [%s] excluded by discover_* config',
|
|
||||||
$ip, ($remote_type || '');
|
|
||||||
next;
|
|
||||||
}
|
|
||||||
|
|
||||||
# risk of things going wrong...?
|
# risk of things going wrong...?
|
||||||
# https://quickview.cloudapps.cisco.com/quickview/bug/CSCur12254
|
# https://quickview.cloudapps.cisco.com/quickview/bug/CSCur12254
|
||||||
|
|
||||||
@@ -246,7 +239,15 @@ sub store_neighbors {
|
|||||||
# what we came here to do.... discover the neighbor
|
# what we came here to do.... discover the neighbor
|
||||||
debug sprintf ' [%s] neigh - %s with ID [%s] on %s',
|
debug sprintf ' [%s] neigh - %s with ID [%s] on %s',
|
||||||
$device->ip, $remote_ip, ($remote_id || ''), $port;
|
$device->ip, $remote_ip, ($remote_id || ''), $port;
|
||||||
push @to_discover, [$remote_ip, $remote_type, $remote_id];
|
|
||||||
|
if (is_discoverable($remote_ip, $remote_type)) {
|
||||||
|
push @to_discover, [$remote_ip, $remote_id];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
debug sprintf
|
||||||
|
' [%s] neigh - skip: %s of type [%s] excluded by discover_* config',
|
||||||
|
$device->ip, $remote_ip, ($remote_type || '');
|
||||||
|
}
|
||||||
|
|
||||||
$remote_port = $c_port->{$entry};
|
$remote_port = $c_port->{$entry};
|
||||||
if (defined $remote_port) {
|
if (defined $remote_port) {
|
||||||
|
|||||||
Reference in New Issue
Block a user