[tkined] Several snmp agent sessions

From: Melanie Hinse (mhinse@lanterncom.com)
Date: Thu Nov 09 2000 - 01:07:45 MET


I browsed through the Q&A archive, and I didn't find the whole solution to
my problem:

I would like to be able to launch many snmp agent sessions in one Scotty.
At the moment, I start one agent per Unix process and it works fine. But I
would really want to simulate "many" agents, and it's not practical to start
many different processes. I'm using Scotty 2.1.9 and Tcl8.0.

To get independent agents, I did pass to them different interpreter handle.
But still two things remains a mystery to me:

1- When my NMS tries to talk to the first agent, I receive the correct
answer, and when I go to talk to the other agents, I receive errors?? What
am I missing?
2- When my NMS talks (sends a get) to one agent on a specific port, all the
other agents receive the request?? I experience this only when I try to
start many agent from one Scotty. Starting them from different processes
don't give me this strange behavior.

There is definitely something I don't understand or that I'm doing wrong??
Is it the way I use the interpreter, the mib instances, my bindings?

Any ideas, suggestions?

Some code follows:

proc CreateAgent { version port {{interp {}}} {
global tnm
set ip [netdb hosts address $tnm(host)]
set s [snmp session -port $port -address $ip -version $version] #version is
$s configure -agent [CreateSafeInterp]

$s bind 1.3 get {puts "get -> session %S : %V"}
$s bind 1.3 set {puts "set -> session %S : %V"}
$s bind "" begin {puts "begin -> session %S : %T %E %I %V}
$s bind "" end {puts "end -> session %S : %T %E %I %V}
return $s

This function would be call as many times as necessary to create many agents
with different port # each time. The CreateSafeInterp is creating a new safe
interpreter each time it is call.

Mélanie Hinse

!! 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.

This archive was generated by hypermail 2b29 : Mon Jan 08 2001 - 15:27:56 MET