For Programmers: Free Programming Magazines  


Home > Archive > PERL Modules > October 2006 > Broken bulkwalk in Net-snmp perl binding









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Broken bulkwalk in Net-snmp perl binding
Hans Jørgen Jakobsen

2006-10-01, 6:58 pm

I am using the perl bindings that is part of Net-snmp package.
(http://www.net-snmp.org/)
I have a problem with bulkwalk used from perl.

It works in (FreeBSD 5.4, perl 5.8.6, net-snmp 5.2.1)
It dosnt work in (FreeBSD 6.1, perl 5.8.8, net-snmp 5.2.3)
Upgrading to net-snmp 5.3.1 dont help.
The command line snmpbulkwalk works.

The problems can be recontructed with the example program bulkwalk.pl that
is part of the package.
The snmp is send to the agent and data is returned. But there is returned
garbage from the call. Instead of the array(refs) there is returned something
looking like the parameter passed to bulkwalk.
Ofcourse the program blows up when trying to use this data.
(If community is wrong, this is handled correct)

%./bulkwalk.pl
Not an ARRAY reference at ./bulkwalk.pl line 65.
(65: $num = scalar @$vbarr;)

I have tried to modify and print what is returned:
%./bulkwalk.pl
@resp dump:
$VAR1 = bless( {
'UseLongNames' => 2,
'UseEnums' => 0,
'UseNumeric' => 1,
'BestGuess' => 0,
'SessPtr' => bless( do{\(my $o = 136253952)}, 'SnmpSessionPtr' ),
'LocalPort' => 0,
'ErrorStr' => '',
'UseSprintValue' => 0,
'Community' => 'public',
'ErrorNum' => 0,
'RetryNoSuch' => 0,
'Retries' => 3,
'RemotePort' => '161',
'Version' => '2c',
'ErrorInd' => 0,
'DestHost' => 'localhost:161',
'Timeout' => 300000
}, 'SNMP::Session' );
$VAR2 = 2;
$VAR3 = 8;
$VAR4 = bless( [
bless( [
'sysUpTime'
], 'SNMP::Varbind' ),
bless( [
'ifNumber'
], 'SNMP::Varbind' ),
bless( [
'ifSpeed'
], 'SNMP::Varbind' ),
bless( [
'ifDescr'
], 'SNMP::Varbind' )
], 'SNMP::VarList' );
Not an ARRAY reference at ./bulkwalk.pl line 67.
%

This looks more or less as the parameters passed to $sess->bulkwalk

Any idea of where the problem are?

I have not tried to downgrade, yet.

/hjj
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com