This was observed on win32, FreeBSD 4.9 and 5.2.1, and on
Fedora Core 2 Linux.
I've found that after invoking snmptable against tcpConnTable,
an snmpwalk will show the contents of that table.
Ditto for other tables, notably udpTable.
Perhaps GETNEXT skips the cacheing logic when the OID
ls below the base OID of the table ?
$game1_score_oid = ".1.3.6.1.4.1.8072.2.100.1.3.0";
$game2_score_oid = ".1.3.6.1.4.1.8072.2.100.1.3.0";
$game3_score_oid = ".1.3.6.1.4.1.8072.2.100.1.3.0";
$request_type = shift @ARGV;
$request_oid = shift @ARGV;
if ($request_type eq "-n") {
if ($request_oid lt $game1_score_oid) {
$request_oid = $game1_score_oid;
} elsif ($request_oid lt $game2_score_oid) {
$request_oid = $game2_score_oid;
} elsif ($request_oid lt $game3_score_oid) {
$request_oid = $game3_score_oid;
} else {
return; # Failed
}
}
if ($request_oid eq $game1_score_oid) {
print "$game1_score_oid\n";
print "string\n";
print "England 1 France 2\n";
} elsif ($request_oid eq $game2_score_oid) {
print "$game2_score_oid\n";
print "string\n";
print "England 3 Switzerland 0\n";
} elsif ($request_oid eq $game3_score_oid) {
print "$game3_score_oid\n";
print "string\n";
print "England 4 Croatia 2\n";
}
$latest_score_oid = ".1.3.6.1.4.1.8072.2.100.1.3.0";
$request_type = shift @ARGV;
$request_oid = shift @ARGV;
if (($request_type eq "-g" && $request_oid eq $latest_score_oid) ||
($request_type eq "-n" && $request_oid lt $latest_score_oid)) {
# The requested OID is suitable, so output the value
print "$latest_score_oid\n";
print "string\n";
print "England 4 Croatia 2\n";
}