> Here's the code snippet...
> 
>  my $snmpGrab = 'sysDescr.0';
>  my $snmpCount = 1;
> 
>  my $var = $session->bulkwalk(0, $snmpCount, $snmpGrab);
>  print $$var[0]->val . "\n";
> 
> Which is simple, straightforward, pretty much grabbed exactly from
> example code.

I'm not quite sure where that example code comes from,
and there may well be More Than One Way To Do This.
But I've found the following approach seems to work reliably.

Firstly, create the varbind list that you want to retrieve using
SNMP::VarList - i.e.

    $var = new SNMP::VarList( ['sysDescr',    '0'] );

Then call the 'bulkwalk' routine with this list.
It will be updated (in place) to contain the results,
which you can then print out as before:

     $session->bulkwalk(0, 1, $var );
     print $var->[0]->val. "\n";


Try that, and see if it's any better.

Dave



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Net-snmp-users mailing list
[EMAIL PROTECTED]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to