update undiscovered neighbors and port properties discovery to use remote_is_discoverable

This commit is contained in:
Oliver Gorwits
2022-05-15 23:16:49 +01:00
parent 1a810d89f3
commit e1bfd917a9
4 changed files with 12 additions and 16 deletions

View File

@@ -8,7 +8,7 @@ use App::Netdisco::Transport::SNMP ();
use Dancer::Plugin::DBIC 'schema';
use Encode;
use App::Netdisco::Util::Device 'match_to_setting';
use App::Netdisco::Util::Device qw/is_discoverable match_to_setting/;
register_worker({ phase => 'main', driver => 'snmp' }, sub {
my ($job, $workerconf) = @_;
@@ -93,6 +93,9 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub {
if scalar grep {match_to_setting($_, 'phone_capabilities')} @$remote_cap
or match_to_setting($remote_type, 'phone_platforms');
$properties{ $port }->{remote_is_discoverable} = 'false'
unless is_discoverable($device_ports->{$port}->remote_ip, $remote_type, $remote_cap);
next unless scalar grep {defined && m/^inventory$/} @{ $rem_media_cap->{$idx} };
$properties{ $port }->{remote_vendor} = $rem_vendor->{ $idx };