temporary fix for snmp agent version check on windows (using snmp v2)

git-svn-id: http://svn.centreon.com/trunk/plugins-2.x@8299 6bcd3966-0018-0410-8128-fd23d134de7e
This commit is contained in:
Nicolas Cordier 2009-06-03 08:25:53 +00:00
parent 9263b444ec
commit abff769b9f
1 changed files with 3 additions and 2 deletions

View File

@ -82,7 +82,7 @@ GetOptions
"l" => \$opt_l);
if ($opt_V) {
print_revision($PROGNAME,'$Revision: 1.2 $');
print_revision($PROGNAME,'$Revision: 1.3 $');
exit $ERRORS{'OK'};
}
@ -149,9 +149,10 @@ if ($snmp eq "1" || $snmp eq "2") {
sub get_netsnmp_version ($){
my $sess = $_[0];
my $OID_VERSION = "1.3.6.1.2.1.25.6.3.1.2";
$sess->max_msg_size(5000);
my $result = $sess->get_table(Baseoid => $OID_VERSION);
if (!defined($result)) {
printf("ERROR when getting CPU percentage use values : ProcessorLoad Table : %s.\n", $session->error);
printf("ERROR when getting SNMP version : %s.\n", $session->error);
$session->close;
exit $ERRORS{'UNKNOWN'};
}