Re: [tkined] trying to ignore the noResponse

Benoit Papillault (papilla@cs.tamu.edu)
Wed, 20 May 1998 16:02:18 -0500 (CDT)

On Wed, 20 May 1998, Samuel Cardwell wrote:

> I have a need to send scotty scripts to a host that is not suppose
> to/not expected to reply back. Is there an snmp session command or
> sequence to tell scotty not to waite for a reply, but to simply send
> without retries, and to not have a timeout?

I do not know why you are trying sending a script via snmp, perhaps socket
could be better. But, with snmp you can use asynchronous operations. It
means that a callback scripts will be called when the operation is
terminated, but the commands returns immediately. Follows a simple example
that make several queries (255) at a time (to detect SNMP agent) and then
wait for the completion. I think you can modifie it to your needs.

proc scanner_snmp2 net {
array set les_sessions ""

# we launch all requests
for {set i 1} {$i<255} {incr i} {
set s [snmp session -address $net.$i]
set les_sessions($i) $s
catch { set id [ $s get sysDescr.0 {
if { "%E"=="noError" } then {
set description [lindex [lindex "%V" 0] 2]
set name [netdb hosts name "%A"]
puts "$name\t:$description"
}
} ]
}
}


# we wait for response
for {set i 1} {$i<255} {incr i} {
set s $les_sessions($i)
$s wait
$s destroy
}
puts Done
}

Benoit Papillault

--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.