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/listinfo/net-snmp-users

Reply via email to