If I were you, I would write something like the following in your script:
$s walk varbinds {callStatusValidFlag callStatusDataRate} {
set nVarbinds [llength $varbinds]
for {set i 0; set j 1} {$j < $nVarbinds} {incr i 2; incr j 2} {
set callStatusValidFlag [linedex [lindex $varbinds $i] 2]
set callStatusDataRate [linedex [lindex $varbinds $j] 2]
# Here, check the value of callStatusValidFlag and compute what
# you need with callStatusDataRate.
}
}
I hope I haven't made some syntax errors (or, even worse, semantics
ones :)
So, the point is to use the walk command as it walks the given objects
by sending get-bulk requests if the session is an SNMPv2 session. And,
if the Ascent box answers the get-bulk requests properly, then you'll
get up to 16 variables (for scotty v.2.0.2) in each response while
walking the variables. This is the way to reduce the agent-to-manager
traffic.
But, if it's an SNMPv1 session, then you'll get only 2 variables per a
response as the get-next requests must be used in the walking.
v
-- rpr. : Robert B. Premuz * Email: rpremuz@public.srce.hr
http://public.srce.hr/~rpremuz/ * Voice at home: +385 (0)1 687564