context and multiple mib-instances

jan-ivar.nymo____4tel.no jan-ivar.nymo____4tel.no
Fri Feb 18 08:52:25 CET 2000


Ok thanks, it will work for get calls because the Request's is a parameter
in get() functions.
However, I can't find a way to (for a multithreaded agent!) reach the right
Request within a set() function. Frank, do you have any suggestion?

thanks in advance!
Jan-Ivar Nymo



-----Original Message-----
From: Frank.Fock____t-online.de [mailto:Frank.Fock____t-online.de]
Sent: 16. februar 2000 01:34
To: agentpp-dl____fock.de
Subject: Re: context and multiple mib-instances


Just now I can say AGENT++v3.4 will have full context support.
A new class MibContext will contain all MibEntries for a specific
context and class Mib contains the default MibContext instance
and all the other user defined contexts.

But, back to your question:

jan-ivar.nymo____4tel.no wrote:

> I'm using the agent to manage some net-close software applications. The
> connection between
> the agent and the apps is through unix-sockets. I do process control
through
> a small
> control-table mib that looks something like this:
>
>    processkey | processtype | status | managementport | PID | PPID | ..|
> RowStatus
>
> So, to start a new process I create a new row in the control table, set
> processkey and
> processtype and activates the row. The agent will then start a process of
> "processtype" and
> fill in the rest of the columns in the particular row.
> In the instrumentation of the mibs for the processtypes then, it would be
> nice to
> be able to do something like this;
>   port = get_mport_from_control_table( req->contextName ); //contextName
as
> processkey
>   val = get_value_from_process( oid, port );

OK, I understand. You can do this right now. For any new context created by
adding a row to your table, you will have to put an entry in the Vacm table,
in order to register your default user for the new context. Then you can
call req->get_pdu().get_context_name() (in 3.4 req->get_context()) to
access the appropriate management information.
[snip]

Best regards,
Frank

>
> -----Original Message-----
> From: Frank.Fock____t-online.de [mailto:Frank.Fock____t-online.de]
> Sent: 15. februar 2000 20:13
> To: agentpp-dl____fock.de
> Subject: Re: context and multiple mib-instances
>
> jan-ivar.nymo____4tel.no wrote:
>
> > how can I use the snmpv3 context(name) to differ between multiple
> > mib-instances in an agent?
>
> Currently, you have to instantiate a Mib instance for each context and
> add instances of the appropriate MibEntries to it. Then you have to
> dispatch the requests in the main loop of your agent to the different
> MIB instances.
>
> >
> > It would be perfect if I could use the context as key in a routingtable
> that
> > describes what route
> > to take to find a specific instance of a mib-variable. But, what I can
see
> > from the examples in
> > agent++, allowed context's have to be predefined when initializing the
> > security constructs.
> >
>
> For the next release (3.4) I would like to change the Mib class as
follows:
>
> * add a new method Mib::add(const OctetStr& context, MibEntryPtr)
> * change the (protected) lookup methods like "find_..." to recognize
> contexts.
>
> Any suggestions?
>
> Best regards,
> Frank



More information about the AGENTPP mailing list