perl module / object value / oid translation

This is a discussion on perl module / object value / oid translation within the SNMP Users forums, part of the Networking and Network Related category; i'm seeing a discrepancy in the value returned by a command-line get versus a get originating from within ...


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

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-25-2005
Stuart Kendrick
 
Posts: n/a
Default perl module / object value / oid translation

i'm seeing a discrepancy in the value returned by a command-line get
versus a get originating from within the Perl SNMP.pm. and i'm wanting
tips on what i can do to trouble-shoot this further.

#### COMMAND-LINE ####
guru> snmpget -c public ja-b-rtr ciscoFlashPartitionFileCount.2.1
CISCO-FLASH-MIB::ciscoFlashPartitionFileCount.2.1 = Wrong Type (should be
Gauge32 or Unsigned32): INTEGER: 2
guru>


#### PERL MODULE ####
guru> cat test
#!/opt/vdops/bin/perl
use strict;
use warnings;
use SNMP;
my ($sess, $val);
#$SNMP::debugging = 2;
$sess = new SNMP::Session ( Community => 'public',
DestHost => 'ja-b-rtr',
);
#$val = $sess->get(".1.3.6.1.4.1.9.9.10.1.1.4.1.1.6.2.1");
$val = $sess->get("ciscoFlashPartitionFileCount.2.1");
print "val = $val\n";
guru>
guru>./test
val = NOSUCHOBJECT
guru>


#### PACKET TRACES ####

i've sniffed on both experiences
(https://vishnu.fhcrc.org/net-snmp/ja-b-rtr.works and
https://vishnu.fhcrc.org/net-snmp/ja-b-rtr.broken) ... both the request
*and* the response are identical ... i.e. i can see the answer of "2"
coming back in both cases.

if i flip the two get statements, then the answer comes back correctly,
i.e.



#### OID vs OBJECT VALUE ####

using the OID instead of the object value:
$val = $sess->get(".1.3.6.1.4.1.9.9.10.1.1.4.1.1.6.2.1");

gives me an answer of '2' instead of NOSUCHOBJECT.


so ... looks like the 'translate' function correctly translates
'ciscoFlashPartitionFileCount.2.1' into an OID on the way out ... but has
trouble reversing the process on the way back.

the command-line translate works just fine:

guru> snmptranslate -On -IR ciscoFlashPartitionFileCount.2.1
..1.3.6.1.4.1.9.9.10.1.1.4.1.1.6.2.1
guru> snmptranslate .1.3.6.1.4.1.9.9.10.1.1.4.1.1.6.2.1
CISCO-FLASH-MIB::ciscoFlashPartitionFileCount.2.1
guru>


#### DEBUGGING ####

i tried running my script with "$SNMP::debugging = 2" set ... the results
are visible at https://vishnu.fhcrc.org/net-snmp/perl-snmp-bug.txt ... i
don't see any problems with the parsing and loading of CISCO-FLASH-MIB ...

here are the relevant chunks from the CISCO-FLASH-MIB file:

CiscoFlashPartitionEntry ::=
SEQUENCE {
ciscoFlashPartitionIndex Unsigned32,
ciscoFlashPartitionStartChip Integer32,
ciscoFlashPartitionEndChip Integer32,
ciscoFlashPartitionSize Unsigned32,
ciscoFlashPartitionFreeSpace Gauge32,
ciscoFlashPartitionFileCount Gauge32,
ciscoFlashPartitionChecksumAlgorithm INTEGER,
ciscoFlashPartitionStatus INTEGER,
ciscoFlashPartitionUpgradeMethod INTEGER,
ciscoFlashPartitionName DisplayString,
ciscoFlashPartitionNeedErasure TruthValue,
ciscoFlashPartitionFileNameLength Integer32
}

ciscoFlashPartitionFileCount OBJECT-TYPE
SYNTAX Gauge32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Count of all files in a flash partition. Both
good and bad (deleted or invalid checksum) files
will be included in this count.
"
::= { ciscoFlashPartitionEntry 6 }


#### WHATS NEXT ####

would anyone have tips on how i could analyze this issue more deeply?


tia,

--sk

stuart kendrick
fhcrc


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
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 Search this Thread
Search this Thread:

Advanced Search
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

BB 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 10:32 PM.


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