On 13/06/07, Need Help <[EMAIL PROTECTED]> wrote:
> I did see when the "make example-demon" command executed then the it
> generates the following files:
>
> example-demon.o
> nstAgentSubagentObject.o

You should see the following three commands:

    cc   -c -o example-demon.o example-demon.c
    cc   -c -o nstAgentSubagentObject.o nstAgentSubagentObject.c
    cc       -o example-demon  example-demon.o nstAgentSubagentObject.o

(with the various compilation flags, etc)

Is that what you see or not?



> .... however, I do not understand how the subagent informs the snmpd master
> agent that all SNMP request relating to the NET-SNMP-TUTORIAL-MIB should be
> sent to the subagent instead of being processed by the snmpd master agent.

The 'nstAgentSubagentObject' module initialisation code will register with the
local subagent framework (example-demon.o) to inform it of the MIB modules it
wishes to handle (i.e. an OID subtree).  This is a standard part of the Net-SNMP
agent processing.
   In this case, this is the netsnmp_register_int_instance() call.

   The subagent framework makes a note of this OID registration locally (so it
knows which module to use), and also sends an AgentX registration request
to the master agent.  This is part of the standard AgentX protocol.

   The AgentX processing module of the master agent receives this AgentX
registration request, and registers this OID subtree with the main master
agent framework.  Again, this is a normal part of the Net-SNMP agent processing.
The main agent doesn't actually care that this is an AgentX registration - it
simply knows to send requests to this particular handler (which happens to
be the AgentX module).

When a GET (or GETNEXT) request comes in, the master agent looks up the
OID in its local registry, and passes the request to the appropriate module.
The AgentX module then forwards this request to the subagent, which looks
up the OID in *its* local registry, and passes the request on to the
appropriate local module (nstAgentSubagentObject).
   In this particular case, there isn't actually any specific code needed to
implement the object (since it's using the 'int_instance' helper).   But in
your MfD examples, this would be the  xxx_handler() routine.



Try it - see whether it works or not.

Dave

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to