Subject: | Some Received Values not being assigned to hash properly |
When using get_table , some retrieved Hex values appear to be stored in
the hash value as "J1" or "J1X" or "J1Y" etc... This occurs only for
about five percent of all values.
In this case, I am requesting a table with 244 elements. Snoops reveal
that sane data is indeed being retrieved.
I will attach a capture file from the workstation doing the polling.
The capture was run with:
snoop -s 1600 -o /home/bestpa/snmp_20100319.cap host 10.33.221.48
In the capture you can see that the value for OID
.1.3.6.1.4.1.3375.2.2.10.1.2.1.3.22.118.115.95.77.77.83.67.95.80.85.66.95.75.79.79.68.79.95.83.77.84.80
is being returned with a value of "4A31000B". However, the stored value
in the hash for that key is "J1Y".
I will also attach script output using session parameter "debug => 0xFF"
in a file.
---------------CODE:
#!/usr/bin/perl
# Functionality test script
use Net::SNMP;
$hostname="10.33.221.48";
$port=161;
$version="snmpv2c";
$community="p4tr1ck_rul3s";
$max_msg_size=65535;
($session, $error) = Net::SNMP->session(
-hostname => $hostname,
-port => $port,
-nonblocking => 0,
-version => $version,
-community => $community,
-maxmsgsize => $max_msg_size,
-timeout => 20,
);
if (!defined $session) {
printf "ERROR: %s.\n", $error;
exit 1;
}
$oidADDRESS=".1.3.6.1.4.1.3375.2.2.10.1.2.1.3";
$resultADDRESS = $session->get_table(
-baseoid => $oidADDRESS,
);
if (!defined $resultADDRESS) {
printf "ERROR: %s\n", $session->error();
$session->close();
exit 1;
}
print "size of IP ADDRESS hash: " . keys(%$resultADDRESS) . ".\n";
while (( my $k,$v) = each %$resultADDRESS) {
print "$k\n$v\n\n";
};
---------------OUTPUT (truncated for brevity to show good versus bad
examples:
.1.3.6.1.4.1.3375.2.2.10.1.2.1.3.21.118.115.95.49.48.95.51.51.95.50.51.56.95.50.50.49.95.54.48.55.48
0x0a21eedd
.1.3.6.1.4.1.3375.2.2.10.1.2.1.3.19.118.115.95.49.48.95.51.51.95.50.51.57.95.56.95.57.48.48.53
0x0a21ef08
.1.3.6.1.4.1.3375.2.2.10.1.2.1.3.21.118.115.95.49.48.95.51.51.95.50.51.56.95.49.57.48.95.57.48.48.52
0x0a21eebe
.1.3.6.1.4.1.3375.2.2.10.1.2.1.3.22.118.115.95.77.77.83.67.95.80.85.66.95.75.79.79.68.79.95.83.77.84.80
J1Y
.1.3.6.1.4.1.3375.2.2.10.1.2.1.3.20.118.115.95.49.48.95.51.51.95.50.51.56.95.56.49.95.49.48.50.53
0x0a21ee51
.1.3.6.1.4.1.3375.2.2.10.1.2.1.3.25.118.115.95.77.65.71.54.46.54.95.80.80.71.95.80.82.83.95.116.114.117.115.116.101.100
0x0a21ef08
.1.3.6.1.4.1.3375.2.2.10.1.2.1.3.19.118.115.95.49.48.95.51.51.95.50.51.57.95.56.95.53.57.57.49
0x0a21ef08
Subject: | snmp_20100319.cap |
Message body not shown because it is not plain text.