On 29/05/07, Shivani Garg <[EMAIL PROTECTED]> wrote: > a) Say I am writing a MIB .my for an object by the name of myObject. I > believe a var_myObject() function will be created by mib2c.
Either var_myObject() (if using the old v4 UCD module API), or myObject_handler() (if using the newer v5 API). The precise details are somewhat different, but the basic idea is much the same. > I wanted to know > how this function is called by the master agent when it receives a snmpget > for an OID corresponding to myObject. The agent keeps a registry of all the OIDs that various MIB modules have told it about. When a request comes in, the main agent framework uses this registry to decide which module to pass the request on to. For a GET (or SET) request, there will only be one module that's relevant. For a GETNEXT request, the agent will work through the registry, calling each module in turn until it gets a value it can use. > What is the flow of communication > between master-agent and sub-agent in this respect. The above description holds true for both master/subagent communication, and for MIB modules implemented within the master agent itself. The only difference for a master/subagent version is that this involves an AgentX GET (or GETNEXT) request, followed by a RESPONSE message. (Rather than a simple internal function call). Things are a bit more complex for SET processing, but don't worry about that just yet. > b) Also, agent_check_and_process() will listen for events on internal FDs > from master-agent (for both GET and SET). Can we send traps also these FDs > or is there any way to register our own external FDs through > agent_check_and_process()?? If yes, then how are these handled by netSNMP. The external FD mechanism is not limited to the standard SNMP GET/SET/etc model. You'd supply a routine to be called whenever there's something waiting to be read from that FD. The agent isn't bothered what this data is, or what it means - that's all left to your code. 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
