Missing mibdirs causes all MIBs to be loaded (with a warning)

This commit is contained in:
Oliver Gorwits
2013-06-03 20:37:39 +01:00
parent 09829a25b8
commit a43c98962a
2 changed files with 9 additions and 1 deletions

View File

@@ -27,6 +27,7 @@
* Buttons for discover/macsuck/arpnip on device details page * Buttons for discover/macsuck/arpnip on device details page
* Support 'path' config option as alternative to --path /mountpoint * Support 'path' config option as alternative to --path /mountpoint
* Local plugins can be placed in ${NETDISCO_HOME}/site_plugins/... * Local plugins can be placed in ${NETDISCO_HOME}/site_plugins/...
* Missing mibdirs causes all MIBs to be loaded (with a warning)
[BUG FIXES] [BUG FIXES]

View File

@@ -149,7 +149,14 @@ sub _try_connect {
sub _build_mibdirs { sub _build_mibdirs {
my $home = (setting('mibhome') || $ENV{NETDISCO_HOME} || $ENV{HOME}); my $home = (setting('mibhome') || $ENV{NETDISCO_HOME} || $ENV{HOME});
return map { dir($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 ) =head2 snmp_comm_reindex( $snmp, $vlan )