fix problem with SNMP session: now max_msg_size is on the global variable and sized to 50000

git-svn-id: http://svn.centreon.com/trunk/plugins-2.x@14093 6bcd3966-0018-0410-8128-fd23d134de7e
This commit is contained in:
Julien Mathis 2013-01-03 15:50:39 +00:00
parent 46409017de
commit 7a0078ff7f
1 changed files with 1 additions and 1 deletions

View File

@ -128,6 +128,7 @@ $name =~ s/\.pl.*//g;
my ($session, $error);
if ($snmp eq "1" || $snmp eq "2") {
($session, $error) = Net::SNMP->session(-hostname => $opt_H, -community => $opt_C, -version => $snmp);
$session->max_msg_size(50000);
if (!defined($session)) {
print("UNKNOWN: SNMP 1 or 2 Session : $error\n");
exit $ERRORS{'UNKNOWN'};
@ -149,7 +150,6 @@ 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 SNMP version : %s.\n", $session->error);