From 629b046a94333204e2f253543539f711bba303ba Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Tue, 28 Nov 2017 21:05:51 +0000 Subject: [PATCH] add log for skipping when duplicate lldpRemChassisId seen --- lib/App/Netdisco/Worker/Plugin/Discover/Neighbors.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/App/Netdisco/Worker/Plugin/Discover/Neighbors.pm b/lib/App/Netdisco/Worker/Plugin/Discover/Neighbors.pm index 8e00116e..308cf67f 100644 --- a/lib/App/Netdisco/Worker/Plugin/Discover/Neighbors.pm +++ b/lib/App/Netdisco/Worker/Plugin/Discover/Neighbors.pm @@ -45,14 +45,19 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub { # discover_* config permits the discovery foreach my $neighbor (@to_discover) { my ($ip, $remote_type, $remote_id) = @$neighbor; - next if $remote_id and $seen_id{ $remote_id }++; + if ($remote_id and $seen_id{ $remote_id }++) { + debug sprintf + ' queue - skip: %s with ID [%s] already queued from %s', + $ip, $remote_id, $device->ip; + next; + } my $device = get_device($ip); next if $device->in_storage; if (not is_discoverable($device, $remote_type)) { debug sprintf - ' queue - %s, type [%s] excluded by discover_* config', + ' queue - skip: %s of type [%s] excluded by discover_* config', $ip, ($remote_type || ''); next; }