On Thu, 2011-03-03 at 20:26 -0800, sujata patra wrote:

> From: Magnus Fromreide <ma...@lysator.liu.se>
> Re: when the agent has been from multiple hosts,
> 
> On Thu, Mar 03, 2011 at 08:17:49AM -0800, sujata patra wrote:
> > 
> > Can you please tell me what will to 3 sets of data ? How can I 
> > differentiate them ?
> 
> You can either change your mib so that it includes instance
> information (let
> yourVariable.0 become a table indexed by instance information -
> yourVariable.[instance]) or you could register them in different
> contexts.
> 
> I hope to modify myagent code to register with different contextName.

I would not have taken that route as that results in interfaces with a
somewhat clunky feel as you can't look at data from multiple subagents
in a single SNMP request.
I do prefer the indexed variant if at all possible.

>  Right now it is using default context. 
> netsnmp_handler_registration *reg;
>        reg = netsnmp_create_handler_registration(.....);
>        reg->contextName = strdup("my_context");
>        netsnmp_register_handler(reg);
> 
> I will be preferring this to put in config file. Is it possible to do so ?

Yes.

> If so, how can I ?

Typically on the sub-agent side to tell the context name it should use
when registering.
You might wish to test how to map the snmp request to the special
context on the agent side as well.

> > I will be interested to know even proxy communication also in this .
> If I run 
> > the myagent to run as master agent and snmp request/response is
> forwarded to 
> > snmpd(host1), will it work out ? How the multiplexing will happen ?
> 
> I do not understand what you are asking here, could you please
> rephrase the question?
> Let's say myagent is running as master agent. myagent and snmpd will
> be configured using proxy. SNMP requests will be forwarded from snmpd
> to myagent and my agent will forward the response to snmpd. Now if
> there is 3 myagents running on 3 different hosts. Which myagent will
> respond to the requests ?

The one that registered that OID in the current context with the highest
priority.

> is the context solution for here too ?

Both methods I described above will solve this problem.

/MF



------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to