From f16bb2cbb3b5be5ba4b6bf6f10724c73d6517b8d Mon Sep 17 00:00:00 2001 From: Stefan Seidel Date: Thu, 25 Nov 2010 14:10:46 +0100 Subject: [PATCH] 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. --- plugins/other/snmp__netstat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/other/snmp__netstat b/plugins/other/snmp__netstat index 4c909ec4..8d2d5aaf 100755 --- a/plugins/other/snmp__netstat +++ b/plugins/other/snmp__netstat @@ -27,7 +27,7 @@ use strict; use Net::SNMP; -my $DEBUG = 0; +my $DEBUG = 1; my $host = $ENV{host} || undef; my $port = $ENV{port} || 161; @@ -151,7 +151,7 @@ sub get_by_regex $num++; next unless ($response->{$ret} =~ /$regex/); @keys = split (/\./, $ret); - $result->{$keys[-1]} = $response->{$ret};; + $result->{$num} = $response->{$ret};; print "# Index $num: ", $keys[-1], " (", $response->{$ret}, ")\n" if $DEBUG; }; return $result;