Perl SNMP module + async + UseNumeric
Carl Hayter <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
I'm having a little problem with the Perl SNMP module when using the
async callback feature + the UseNumeric feature, I can't seem to figure
out what could be going wrong. This is with the latest 5.3.1 version
of net-snmp and perl 5.8.8. I've attempted to search the bug reports,
but I don't find anything recent. Does anybody have an idea about what's
going on here?
Without UseNumeric, the data passed to the callback is as expected:
Text:
$VAR1 = bless( [
bless( [
'sysServices',
'0',
'71',
'INTEGER'
], 'SNMP::Varbind' )
], 'SNMP::VarList' );
With UseNumeric, the data passed to the callback is missing the
Oid and Index fields:
Numeric:
$VAR1 = bless( [
bless( [
'',
'',
'71',
'INTEGER'
], 'SNMP::Varbind' )
], 'SNMP::VarList' );
Here's my minimal test case script:
#!/usr/bin/perl
use SNMP;
use Data::Dumper;
my %session_params = (
DestHost => 'localhost', # changed to protect innocent
Community => 'public', # changed to protect innocent
Version => 1,
);
my $vb_text = SNMP::Varbind->new( [ 'sysServices', 0 ] );
my $vb_numeric = SNMP::Varbind->new( [ '.1.3.6.1.2.1.1.7', 0 ] );
sub callback { print Dumper($_[0]); SNMP::finish(); }
my $session_text = SNMP::Session->new( %session_params );
print "Text:\n";
$session_text->get( $vb_text, \&callback );
SNMP::MainLoop();
my $session_numeric = SNMP::Session->new( %session_params, UseNumeric => 1 );
print "Numeric:\n";
$session_numeric->get( $vb_numeric, \&callback );
SNMP::MainLoop();
----
Carl Hayter
Data Network Operations
University of Southern California
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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