> > Eleni> The packets returned from Cisco do have the correct data, I > Eleni> checked with tcpdump (see attached in my previous message). The > Eleni> parsing from the net-snmp seems buggy as it receives complete > Eleni> SNMP packets and returns incomplete varbinds in perl. > > Could you try 5.3.pre4 or better as well and see if the problem still > exists there? It contains some fixes in that area I think. > > -- > Wes Hardaker > Sparta, Inc. >
Hi, I apologize for this late reply. I tried 5.3.pre4 and I get exactly the same behaviour as with 5.2.1. For your reference I include below the script and the output, they are the same as in my previous emails. Regards, Eleni perl script ============================= #!/usr/bin/perl #use strict; use SNMP; ###- INITIALIZE -### my $hostipaddr = shift; if (!defined $hostipaddr) { printf ("usage: get-stats-if.pl IPAddr\n"); exit 0; } ###- INITIALIZE SNMP -### my $port='161'; my $community='eleni'; $SNMP::debugging = 0; $SNMP::dump_packet = 0; $sess = new SNMP::Session( 'DestHost' => $hostipaddr, 'Community' => $community, 'RemotePort' => $port, 'Timeout' => 300000, 'Retries' => 3, 'Version' => '2c', 'UseLongNames' => 1, # Return full OID tags 'UseNumeric' => 1, # Return dotted decimal OID 'UseEnums' => 0, # Don't use enumerated vals 'UseSprintValue' => 0); # Don't pretty-print values die "Cannot create session: ${SNMP::ErrorStr}\n" unless defined $sess; my $vars = new SNMP::VarList( ['sysUpTime'], # statistics # cardIfIndexEntry in OLD-CISCO-CHASSIS [".1.3.6.1.4.1.9.3.6.13.1.2"], [".1.3.6.1.4.1.9.3.6.13.1.3"], # ifXEntry in ifMIB (RFC2233) ['ifXEntry'] ); ###- DO SNMP BULKWALK -### # get the time ($sec,$min,$hour,$day,$mon,$year) = localtime(time); my $ptime = sprintf("%02s-%02s-%02s %02s:%02s:%02s", $year+1900, $mon+1, $day, $hour, $min, $sec); # do the bulkwalk @resp = $sess->bulkwalk(1, 16, $vars); die "Cannot do bulkwalk: $sess->{ErrorStr} ($sess->{ErrorNum})\n" if $sess->{ErrorNum}; print "SNMP VERSION = " . $SNMP::VERSION . "\n\n"; ###- PARSE SNMP OUTPUT -### # iterate per requested SNMP object for $vbarr ( @resp ) { $oid = $$vars[$i++]->tag(); # display SNMP output $num = scalar @$vbarr; print "$num responses for oid $oid: \n"; # iterate per returned SNMP object instance for $v (@$vbarr) { printf("\t%s = %s (%s)\n", $v->name, $v->val, $v->type); } print "\n"; } exit 0; perl output ============================= SNMP VERSION = 5.3.pre4 1 responses for oid sysUpTime: .1.3.6.1.2.1.1.3.0 = 2105512140 (TICKS) 16 responses for oid .1.3.6.1.4.1.9.3.6.13.1.2: .1.3.6.1.4.1.9.3.6.13.1.2.1 = 0 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.2.2 = 0 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.2.3 = 1 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.2.4 = 1 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.2.5 = 1 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.2.6 = 1 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.2.7 = 4 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.2.8 = 4 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.2.9 = 4 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.2.10 = 4 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.2.11 = 4 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.2.12 = 4 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.2.13 = 4 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.2.14 = 4 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.2.15 = -1 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.2.16 = 2 (INTEGER) 16 responses for oid .1.3.6.1.4.1.9.3.6.13.1.3: .1.3.6.1.4.1.9.3.6.13.1.3.1 = 0 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.3.2 = 1 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.3.3 = 0 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.3.4 = 1 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.3.5 = 2 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.3.6 = 3 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.3.7 = 0 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.3.8 = 1 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.3.9 = 2 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.3.10 = 3 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.3.11 = 4 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.3.12 = 5 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.3.13 = 6 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.3.14 = 7 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.3.15 = -1 (INTEGER) .1.3.6.1.4.1.9.3.6.13.1.3.16 = 0 (INTEGER) 767 responses for oid ifXEntry: .1.3.6.1.2.1.31.1.1.1.1.1 = Fa0/0 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.2 = Fa0/1 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.3 = Se1/0 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.4 = Se1/1 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.5 = Se1/2 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.6 = Se1/3 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.7 = Se4/0 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.8 = Se4/1 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.9 = Se4/2 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.10 = Se4/3 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.11 = Se4/4 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.12 = Se4/5 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.13 = Se4/6 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.14 = Se4/7 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.15 = Nu0 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.16 = E1 2/0 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.25 = Se2/0:0 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.26 = Se2/0:1 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.27 = Se2/0:2 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.28 = Se2/0:3 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.29 = Se2/0:4 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.30 = Se2/0:5 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.31 = Se2/0:6 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.32 = Se2/0:7 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.33 = Se2/0:8 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.34 = Se2/0:9 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.35 = Se2/0:10 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.36 = Se2/0:11 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.37 = Se2/0:12 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.38 = Se2/0:13 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.39 = Se2/0:14 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.40 = Se2/0:15 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.42 = Se2/0:17 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.43 = Se2/0:18 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.44 = Se2/0:19 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.45 = Se2/0:20 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.46 = Se2/0:21 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.47 = Se2/0:22 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.48 = Se2/0:23 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.49 = Se2/0:24 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.50 = Se2/0:25 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.51 = Se2/0:26 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.52 = Se2/0:27 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.53 = Se2/0:28 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.54 = Se2/0:29 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.55 = Se2/0:30 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.56 = Se2/0:15 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.58 = Se2/0:1 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.59 = Se2/0:2 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.60 = Se2/0:3 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.61 = Se2/0:4 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.62 = Se2/0:5 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.63 = Se2/0:6 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.64 = Se2/0:7 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.65 = Se2/0:8 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.66 = Se2/0:9 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.67 = Se2/0:10 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.68 = Se2/0:11 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.69 = Se2/0:12 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.70 = Se2/0:13 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.71 = Se2/0:14 (OCTETSTR) .1.3.6.1.2.1.31.1.1.1.1.72 = Se2/0:16 (OCTETSTR) [... stuff deleted] ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&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