Re: How net-snmp identifies the coresponding subagent?

Dave Shield <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On 18 January 2011 16:05, Benix Vincent <[email protected]> wrote:
> I have one master agent and two subagents. Now I register a lot of mibs from
> two of the sub agents using register_mib (). when a request comes from
> outside world, how net-snmpd identifies the corresponding subagent to
> forward?

When the subagent registers a MIB module, it specifies the root of the
OID subtree that it wishes to handle.   This root OID is passed to the
master agent as part of the registration request.

When the master receives an incoming request, it looks for the registered
OID that most closely matches the OID(s) in this request.

So if subagent A registers  .1.3.6.1.2
and subagent B registers  .1.3.6.1.2.1

then a request for .1.3.6.1.2.1.1.0  will be passed to subagent B,
while a request for .1.3.6.1.2.2.1.0 will be passed to subagent A


If both subagents try to register the same root OID, then the first
one to register will be assigned responsibility for that subtree,
and the second one will be told "Sorry, that's already taken".
Requests for that subtree will be passed to the one that got there
first.

    [ In fact, this is a slight simplification, as there's also a
      "priority" associated with each registration.   So two
      subagents could register the same root OID with different
      priorities, and the higher priority will be used.
         But unless you specify this explicitly in the MIB module
      init routine, the default priority will be used for both.   ]



> or How subagent idenfies that the request if for it?

As far as the subagent is concerned - if it receives a request,
then that request is for it to deal with.
   It simply won't see anything that isn't relevant

Dave

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.