X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fbroadband_snmp_get.pm;h=1a8661286c0862430b640ee7ad18ddffbea06900;hp=18ba8ea558a340b84465a1c5bab41aa87815dd05;hb=c21233541988b9a7bd531824b64f4af93bb10dac;hpb=89f20354f28d524a68fdb46b59b55ec79b7f08ea diff --git a/FS/FS/part_export/broadband_snmp_get.pm b/FS/FS/part_export/broadband_snmp_get.pm index 18ba8ea55..1a8661286 100644 --- a/FS/FS/part_export/broadband_snmp_get.pm +++ b/FS/FS/part_export/broadband_snmp_get.pm @@ -96,18 +96,19 @@ sub snmp_results { if ($vers eq '1') { my $varbind = new SNMP::Varbind [$oid]; my $max = 1000; #sanity check - while ($max > 0 and $snmp->getnext($varbind)) { + while ($max > 0 and defined($snmp->getnext($varbind))) { last if $snmp->{'ErrorStr'}; last unless $SNMP::MIB{$varbind->[0]}; # does this happen? my $nextoid = $SNMP::MIB{$varbind->[0]}->{'objectID'}; last unless $nextoid =~ /^$oid/; $max--; - push @values, new SNMP::Varbind [ @$varbind ]; + push @values, [ @$varbind ]; } } else { # not clear on what max-repeaters (25) does, plucked value from example code # but based on testing, it isn't capping number of returned values - @values = $snmp->bulkwalk(0,25,$oid); + my ($values) = $snmp->bulkwalk(0,25,$oid); + @values = @$values if $values; } if ($snmp->{'ErrorStr'} || !@values) { push @out, { 'error' => $snmp->{'ErrorStr'} || 'No values retrieved' };