Skip Menu |
 

This queue is for tickets about the SNMP CPAN distribution.

Report information
The Basics
Id: 29338
Status: open
Priority: 0/
Queue: SNMP

People
Owner: Nobody in particular
Requestors: rabbit+bugs [...] rabbit.us
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: SNMP unable to process certain OIDs (exception || undef)
Date: Thu, 13 Sep 2007 13:16:33 +0200
To: bug-SNMP [...] rt.cpan.org
From: Peter Rabbitson <rabbit+bugs [...] rabbit.us>
Download (untitled) / with headers
text/plain 299b
Hi, Attached are a simple test script and the output when being run against a Cisco Catalyst 2950 switch. Net::SNMP seems to be doing just great, while SNMP fails on 3 out of 4 polls. Is this intended behavior and Net::SNMP is supposed to be a superset of SNMP? Or is this a bug? Thanks Peter
Download snmp_test
text/plain 1.4k
#!/usr/bin/perl use warnings; use strict; use Net::SNMP; use SNMP; use Data::Dumper; $Data::Dumper::Useqq = 1; $| = 1; my $switchaddr = '192.168.58.254'; my $community = 'snmp_poll'; my $snmp = SNMP::Session->new ( DestHost => $switchaddr, Community => $community, Version => '2c', ) or die "Unable to connect to $switchaddr via SNMP\n"; my $net_snmp = Net::SNMP->session ( -hostname => $switchaddr, -version => '2c', -community => $community, ) or die "Unable to connect to $switchaddr via Net::SNMP\n"; show_modules(); for my $oid (qw/ .1.3.6.1.2.1.1 .1.3.6.1.2.1.2.2 .1.3.6.1.2.1.16.19 .1.3.6.1.2.1.17.4.3.1.1 /) { my $response; print "\nTrying Net::SNMP->get_table on $oid\n=========================\n"; eval { $response = $net_snmp->get_table (-baseoid => $oid) }; if ($@) { print "FAILED: $@\n"; } else { print Dumper $response; } print "\nTrying SNMP->gettable on $oid\n=========================\n"; eval { $response = $snmp->gettable ($oid) }; if ($@) { print "FAILED: $@\n"; } else { print Dumper $response; } } sub show_modules { no strict 'refs'; printf "Perl Version: %vd\n\nCurrently loaded modules:\n===========================\n", $^V; for my $mod (sort keys %INC) { $mod =~ s/\.pm$// or next; $mod =~ s!/!::!g; printf "%s => %s\n", $mod, $mod->VERSION || 'Unknown'; } print "\n"; }
Download snmp_test.result.gz
application/x-gzip 11.2k

Message body not shown because it is not plain text.

CC: net-snmp-coders <net-snmp-coders [...] lists.sourceforge.net>
Subject: Re: [rt.cpan.org #29338] SNMP unable to process certain OIDs (exception || undef)
Date: Thu, 13 Sep 2007 10:27:53 -0400
To: bug-SNMP [...] rt.cpan.org
From: "G. S. Marzot" <gmarzot [...] marzot.net>
Download (untitled) / with headers
text/plain 1.2k
Peter Rabbitson via RT wrote: Show quoted text
> Thu Sep 13 07:17:24 2007: Request 29338 was acted upon. > Transaction: Ticket created by rabbit+bugs@rabbit.us > Queue: SNMP > Subject: SNMP unable to process certain OIDs (exception || undef) > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: rabbit+bugs@rabbit.us > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=29338 > > > > Hi, > > Attached are a simple test script and the output when being run against > a Cisco Catalyst 2950 switch. Net::SNMP seems to be doing just great, > while SNMP fails on 3 out of 4 polls. Is this intended behavior and > Net::SNMP is supposed to be a superset of SNMP? Or is this a bug? >
My guess is that the MIB is not loaded for the SNMP implementation and so it does not know how to interpret table boundaries. To answer your questions above: No - there is no explicit relationship between net::SNMP which is an all perl implementation and 'SNMP' which is based on the net-snmp opensource ssnmp toolkit. (confusing I know because Net::SNMP sounds alot like net-snmp). Not sure if it s abug...others may be able to comment if get_table works and depends on the MIB being parsed. regards G S Marzot


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.