Re: snmp agent(s)

Buz Owen (ado@BBN.COM)
Thu, 07 Mar 1996 19:50:20 -0500

Juergen Schoenwaelder <schoenw@ibr.cs.tu-bs.de> wrote:

>Hi.

Hi. thanks for your quick reply....

...

> Buz> Both agents act like they were instanced to variable nb. I
> Buz> suspect this is somehow related to my configuring -agent {}.
> Buz> But it still seems like a bug.
>
> Not really a bug. You are using only one interpreter and hence the
> instance sysName.0 only exists once. It does make some sense to me to
> allow multiple agents (perhaps with different parameters etc.) to
> share the same instances. To get two independend agents, you would
> need to create two different name spaces for them. This can be done by
> creating a new interpreter and passing the interpreter handle to the
> -agent option.

I am using scotty with itcl, so maybe I can get the behaviour I need
using itcl namespaces.

>
> This is how things should work. However, there is a short-coming in
> the implementation. Scotty currently only maintains one instance tree
> for all Tcl interpreters. This needs to get fixed.
>

To me it doesn't make sense that the two agent sessions can share
the same mib tree, even in the same interpreter. Sharing the mib
tree only makes it possible to advertise the same mib tree on
more than one port. I suppose I could so something klugey with
bind to get around this.

> Buz> Anyway, is there any easy way to fix this?
>
> It requires to rework some internal functions that deal with the
> instance tree. Some care is needed to free the instance tree whenever
> an interpreter is destroyed etc. It is not something I would do in an
> hour - so this has to wait.
>

I will have to live with one agent per unix process for a while. If I
get a bit of time to volunteer, I will.

> Buz> As an aside, I don't see why it is even meaningful for an snmp
> Buz> agent be able to specify a safe tcl interpreter. An snmp
> Buz> client can't send a tcl script to an snmp server.
>
> Yes, this is true as long as your agent does not evaluate anything
> stored inside of a SNMP instance/variable. You have to be careful to
> avoid any direct or indirect calls to eval. The warning is just there
> to remind you. (Just edit the source to get rid of it.)
>

But presumably you are not saying the interpreter argument is there
just as a warning (:-)).

Is there any tcl code interpreted from within an snmp session besides
that given to snmp# bind or trace variable commands?

Here's what may be a dumb tcl question. Without stcl, and without
escaping into C, is there any way to create extra tcl interpreters
from tcl?

> Juergen

thanks again.

/buz