1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-23 06:35:42 +00:00

Now working ;) Really, the previous version reported way too low values because of a wrong implementation. This is tested and correct now for Windows and pfSense SNMP hosts.

This commit is contained in:
Stefan Seidel 2010-11-25 14:10:46 +01:00 committed by Steve Schnepp
parent 7266e9ab5c
commit f16bb2cbb3

View file

@ -27,7 +27,7 @@
use strict; use strict;
use Net::SNMP; use Net::SNMP;
my $DEBUG = 0; my $DEBUG = 1;
my $host = $ENV{host} || undef; my $host = $ENV{host} || undef;
my $port = $ENV{port} || 161; my $port = $ENV{port} || 161;
@ -151,7 +151,7 @@ sub get_by_regex
$num++; $num++;
next unless ($response->{$ret} =~ /$regex/); next unless ($response->{$ret} =~ /$regex/);
@keys = split (/\./, $ret); @keys = split (/\./, $ret);
$result->{$keys[-1]} = $response->{$ret};; $result->{$num} = $response->{$ret};;
print "# Index $num: ", $keys[-1], " (", $response->{$ret}, ")\n" if $DEBUG; print "# Index $num: ", $keys[-1], " (", $response->{$ret}, ")\n" if $DEBUG;
}; };
return $result; return $result;