Difference between revisions of "Template:FAQ:Agent 04"

From Net-SNMP Wiki
Jump to: navigation, search
(5.4 release synchronisation)
(Fix references to agent extension FAQ entries.)
Line 9: Line 9:
 
approaches that can be used to do this:
 
approaches that can be used to do this:
  
*  The agent can invoke an external command or shell script to return the necessary information.  There are several possible variations on this approach - see the [[FAQ:Coding_07|next entry]] for details.
+
*  The agent can invoke an external command or shell script to return the necessary information.  There are several possible variations on this approach - see the [[FAQ:Agent_07|next entry]] for details.
  
* The agent can pass the request off to another (sub-)agent, which already implements the required MIB.  Again, there are several ways of doing this - including AgentX, SMUX and proxied SNMP.  See the [[FAQ:Coding_09|next entry but one]] for details.
+
* The agent can pass the request off to another (sub-)agent, which already implements the required MIB.  Again, there are several ways of doing this - including AgentX, SMUX and proxied SNMP.  See the [[FAQ:Agent_08|next entry but one]] for details.
  
 
* You can write code to implement the new MIB objects, and include this within the agent.  This is most commonly C (or C++) code, although the agent can also support MIB modules implemented in perl or (from 5.4) python.<BR>See the [[FAQ:Coding|next section]] (CODING) for more details.
 
* You can write code to implement the new MIB objects, and include this within the agent.  This is most commonly C (or C++) code, although the agent can also support MIB modules implemented in perl or (from 5.4) python.<BR>See the [[FAQ:Coding|next section]] (CODING) for more details.

Revision as of 08:55, 11 June 2008

As indicated above, this basically involves writing some code to implement the objects defined in the new MIB. There are three basic approaches that can be used to do this:

  • The agent can invoke an external command or shell script to return the necessary information. There are several possible variations on this approach - see the next entry for details.
  • The agent can pass the request off to another (sub-)agent, which already implements the required MIB. Again, there are several ways of doing this - including AgentX, SMUX and proxied SNMP. See the next entry but one for details.
  • You can write code to implement the new MIB objects, and include this within the agent. This is most commonly C (or C++) code, although the agent can also support MIB modules implemented in perl or (from 5.4) python.
    See the next section (CODING) for more details.

Note that there is no visible difference between external commands, subagents, and modules implemented within the main agent itself. Tools querying the agent will see a single MIB structure.