Re: snmp agent(s)

Juergen Schoenwaelder (schoenw@ibr.cs.tu-bs.de)
Tue, 12 Mar 1996 00:06:41 +0100

Hi!

Buz Owen <ado@BBN.COM> said:

Buz> Here's a suggestion for the future. Provide some way to clone
Buz> two sessions so that they have the same mib tree, and some
Buz> other way to get them to have different trees.

You can do that right now (if I fix the implementation to associate
the instance tree with a Tcl interpreter):

# Two sessions that share the same mib tree:
set a1 [snmp session -agent ""]
set a2 [snmp session -agent ""]

# Two sessions that have their own private mib trees:
set b1 [snmp session -agent [interp create]]
set b2 [snmp session -agent [interp create]]

The problem here is that you must make sure that all interpreters know
at least the required set of Tcl proc's. On the other hand, b1 and b2
can use the same Tcl variable name(s) to hold different MIB values
(each interpreter controls its own set of global variables). This
makes scripts a bit easier to write because they do not need to worry
about the name space.

(There might be better solutions with real name spaces - but I guess
we will have to wait quite some time to see them in the Tcl core.)

Juergen