diff --git a/Netdisco/Changes b/Netdisco/Changes index 0f99ffd3..a5daeaae 100644 --- a/Netdisco/Changes +++ b/Netdisco/Changes @@ -27,6 +27,7 @@ * Buttons for discover/macsuck/arpnip on device details page * Support 'path' config option as alternative to --path /mountpoint * Local plugins can be placed in ${NETDISCO_HOME}/site_plugins/... + * Missing mibdirs causes all MIBs to be loaded (with a warning) [BUG FIXES] diff --git a/Netdisco/lib/App/Netdisco/Util/SNMP.pm b/Netdisco/lib/App/Netdisco/Util/SNMP.pm index e7f1964b..a2703288 100644 --- a/Netdisco/lib/App/Netdisco/Util/SNMP.pm +++ b/Netdisco/lib/App/Netdisco/Util/SNMP.pm @@ -149,7 +149,14 @@ sub _try_connect { sub _build_mibdirs { my $home = (setting('mibhome') || $ENV{NETDISCO_HOME} || $ENV{HOME}); return map { dir($home, $_) } - @{ setting('mibdirs') || [] }; + @{ setting('mibdirs') || _get_mibdirs_content($home) }; +} + +sub _get_mibdirs_content { + my $home = shift; + warning 'Netdisco SNMP work will be really slow - loading ALL MIBs. Please set mibdirs.'; + my @list = map {s|$home/||; $_} grep {-d} glob("$home/*"); + return \@list; } =head2 snmp_comm_reindex( $snmp, $vlan )