#1059 add NETDISCO_SNMP_BULKWALK_OFF environment to disable bulkwalk

This commit is contained in:
Oliver Gorwits
2023-07-12 21:42:24 +01:00
parent 0c7371f56b
commit 6f8af7ed9d
2 changed files with 6 additions and 1 deletions

View File

@@ -172,6 +172,10 @@ if ($ENV{NETDISCO_DOMAIN}) {
}
}
# override SNMP bulkwalk from environment
config->{'bulkwalk_off'} = true
if (exists $ENV{NETDISCO_SNMP_BULKWALK_OFF} and $ENV{NETDISCO_SNMP_BULKWALK_OFF});
# check user's port_control_reasons
config->{'port_control_reasons'} =

View File

@@ -185,7 +185,8 @@ sub _snmp_connect_generic {
$snmp_args{ $k } = setting('net_snmp_options')->{ $k };
}
if (scalar keys %{ setting('net_snmp_options') }) {
if (scalar keys %{ setting('net_snmp_options') }
or not $snmp_args{BulkWalk}) {
foreach my $k (sort keys %snmp_args) {
next if $k eq 'MibDirs';
debug sprintf 'snmp transport conf: %s => %s', $k, $snmp_args{ $k };