Corrupt VarBinds from SNMP.pm

This is a discussion on Corrupt VarBinds from SNMP.pm within the SNMP Users forums, part of the Networking and Network Related category; Hello I'm using SNMP.pm 5.0401 from Debian's release of 5.4.1 which is 5.4....


Go Back   Usenet Forums > Networking and Network Related > SNMP Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-28-2008
Peter Hicks
 
Posts: n/a
Default Corrupt VarBinds from SNMP.pm

Hello

I'm using SNMP.pm 5.0401 from Debian's release of 5.4.1 which is
5.4.1~dfsg-7.1.

Running the following code:

#!/usr/bin/perl -w

use strict;
use warnings;
use SNMP;

my $sess = new SNMP::Session( DestHost => 'localhost', Community => 'public', Version => 2 );

my @vbl;

push @vbl, [ 'sysUpTime', 0 ];
push @vbl, [ 'sysName', 0 ];
push @vbl, [ 'sysLocation', 0 ];
push @vbl, [ 'sysContact', 0 ];

my $varlist = new SNMP::VarList(@vbl);

$sess->get($varlist);

print "ERROR WAS: ".$sess->{'ErrorStr'}."\n";

foreach my $vb (@$varlist) {

print "0:".$vb->[0]."\n";
print "1:".$vb->[1]."\n";
print "2:".$vb->[2]."\n";
print "3:".$vb->[3]."\n";

}

....produces strange results:

ERROR WAS:
0:sysUpTimeInstance
1:
2:20887615
3:TICKS
0:sysName.0
1:
2:ysName.0nstance<HEX>
3:OCTETSTR
0:sysLocation.0
1:
2:ysLocation.0
3:OCTETSTR
0:sysContact.0
1:
2:ysContact.0nce<HEX>
3:OCTETSTR

<HEX> in this case is some random high-ASCII unprintable characters.

I can't figure out why this is happening. Using snmpget:

pwh@devil:/tmp$ snmpget localhost -c public -v 2c sysUpTime.0 sysName.0 sysLocation.0 sysContact.0
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (20896259) 2 days, 10:02:42.59
SNMPv2-MIB::sysName.0 = STRING: devil.noc.example.com
SNMPv2-MIB::sysLocation.0 = STRING: Datacentre 4
SNMPv2-MIB::sysContact.0 = STRING: Operations <operations@example.com>

Just getting sysUpTime in perl works fine, it's only when I try to get the
other OIDs that things go wrong.

Can anyone help me troubleshoot?


Peter

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/...net-snmp-users

Reply With Quote
  #2 (permalink)  
Old 05-31-2008
Thomas Anders
 
Posts: n/a
Default Re: Corrupt VarBinds from SNMP.pm

Peter Hicks wrote:
> I'm using SNMP.pm 5.0401 from Debian's release of 5.4.1 which is
> 5.4.1~dfsg-7.1.
>
> ...produces strange results:


For the records: this seems to be a Debian bug introduced by a recent
bug fix attempt. The Debian package is about to be updated.

See http://bugs.debian.org/483588 for the details and progress.


+Thomas

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/...net-snmp-users

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:22 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0