consider following script named testme:
----------------------------------------------------------------------
set s [snmp session -a 134.58.1.2 -timeout 3 -retries 0]
set err [catch {$s get 1.3.6.1.2.1.2.2.1.16.10} result]
if $err {
puts "first: failed to retrieve values: $result"
}
puts "first: $result"
set s [snmp session -a 134.58.1.2 -timeout 3 -retries 0]
set err [catch {$s get 1.3.6.1.2.1.2.2.1.10.10} result]
if $err {
puts "second: failed to retrieve values: $result"
}
puts "second: $result"
exit
----------------------------------------------------------------------
with the following result:
amber:bin [patrick] $ /usr/local/ALPHA/bin/scotty -f ./testme
first: failed to retrieve values: no response after 0 retries
first: no response after 0 retries
second: {1.3.6.1.2.1.2.2.1.10.10 Counter 533874046}
amber:bin [patrick] $
However, both variables do exist, and are accessible:
amber:bin [patrick] $ snmpget -h 134.58.1.2 1.3.6.1.2.1.2.2.1.16.10
Request Id: 0
Error: noError
Index: 0
Count: 1
Name: 1.3.6.1.2.1.2.2.1.16.10
Kind: Counter
Value: 3695247332
amber:bin [patrick] $ snmpget -h 134.58.1.2 1.3.6.1.2.1.2.2.1.10.10
Request Id: 0
Error: noError
Index: 0
Count: 1
Name: 1.3.6.1.2.1.2.2.1.10.10
Kind: Counter
Value: 533883311
amber:bin [patrick] $