gettable method broken or limited ?

"Fitzgerald, Peter N" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <01755F59A78A8C4CBE7A3FF46A4166D1019422C5@bmapdm-xch01.apac.ent.bhpbilliton.net>
I have been trying to get the gettable method working with no success
(sort of).

I am trying to get at a table in the Cisco class based qos mib using
gettable with no success.

All I get is the following error...

 

C:\Perl>perl testthis.pl

Cannot find module: At line 1 in (none)

STORE(SNMP::MIB=HASH(0x19fb740) enterprises.9.9.166.1.1.1
HASH(0x1a4c44c)) : write access to the MIB not implemented

Modification of non-creatable array value attempted, subscript -1 at
C:/Perl/site/lib/SNMP.pm line 694.

 

The code is simple and basically straight from the man page

 

#!/usr/bin/perl

  use SNMP;

  use Data::Dumper;

  use strict;

  #my $mib='CISCO-CLASS-BASED-QOS-MIB';

  my $mibs='ALL';

  &SNMP::loadModules(my $mibs);

  my $hostname="xxx.xxx.xxx.xxx";

  my $comm="somename";

  my $port="161";

  

   my $sess = new SNMP::Session( 'DestHost'   => $hostname,

                                       'Community'   => $comm,

                                       'RemotePort'  => $port,

                                       'Timeout'   => 5000000,

                                       'Version'        => '2',);

  die "Cannot create session: ${SNMP::ErrorStr}\n" unless defined $sess;

  print Dumper($sess->gettable('1.3.6.1.4.1.9.9.166.1.1.1'));

 

If I substitute the above oid for "ifTable" or its oid, the results are
as expected.

If I use the command line "SNMPTABLE" on the same device and oid, the
results are as I would expect.

 

Is it my poor code or gettable/SNMP.PM ?

 

Thanks in advance

Peter Fitz
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.