Re: How to use the community in a scotty based SNMP agent?

Peder Chr. Norgaard (pcn@tbit.dk)
Tue, 25 Jul 1995 21:07:58 +0200 (CDT)

First let me express my heartfelt thanks for your quick responses;
that really adds value to the product! I hope I will be able to
reciprocate with test results and evaluations.

Then back to business:

> Peder> I would like the agent to access different remote
> Peder> targets, based on the community string in the SNMP requests
> Peder> that are serviced.
>
> Peder> So my question No 2: How do I access the community
> Peder> string in the commands bound by "snmp bind". And how do I
> Peder> associate different instance trees with different communities?
>
> You can get the session handle that triggered the binding using the %S
> substitution. So you can get the community string using
>
> set c [%S cget -community]
>
> in the binding.

You are right, this works; I failed to appreciate that the general
format escapes for callbacks also work for the "snmp bind" commands.

I will recommend that you include a note on this in the documentation
of "snmp bind"; it is not evident, as the %V, %R etc are described as
belonging to callbacks for "Most SNMP commands described below..." -
which does not include the "snmp bind"!

> The second part of question #2 is a bit more
> interesting, as the current implementation does not support different
> instance trees for different agent sessions. This is very likely to
> change in a future version, as I am integrating the safe Tcl extension
> (stcl-0.1) and this requires to make sure that different agents in one
> scotty process do not share a global ressource like the instance tree.

Needless to say, I look forward to this and will be willing to beta test
such an extension as soon as it is released.

The facility is not crucial for my purpose; for now, my proxy agent
can proxy for one target system only per agent - but that is much
better than having no proxy agent at all!

> Juergen
>

best regards
--peder chr.

Peder Chr. Norgaard
Telebit Communications A/S
Denmark