Difference between revisions of "Template:FAQ:Coding 02"

From Net-SNMP Wiki
Jump to: navigation, search
(5.4 release synchronisation)
(Latest FAQ revision - preparing for 5.5 release)
 
Line 13: Line 13:
 
some other application.  Handling this is much more complex - since
 
some other application.  Handling this is much more complex - since
 
a lot depends on what mechanisms are provided for retrieving (and
 
a lot depends on what mechanisms are provided for retrieving (and
possibly updating) this information.
+
possibly updating) this information. The <CODE>mib2c</CODE> tool can generate code
 +
for processing SNMP requests, based on some internal cache of management
 +
information, but it cannot help with populating this cache with the
 +
underlying data.  That is up to the MIB implementer.
 +
 
 
    
 
    
 
See the existing MIB modules in the Net-SNMP source tree for various
 
See the existing MIB modules in the Net-SNMP source tree for various
 
examples of assorted approaches to this task.
 
examples of assorted approaches to this task.

Latest revision as of 19:33, 20 July 2009

That's typically the hardest bit of implementing a new MIB module, and is the one thing that 'mib2c' can't help with. It very much depends on the MIB variable concerned (and often the underlying operating system as well).

Relatively few MIB modules are completely self-contained, with all the information held internally within the agent, and all updates being done via SNMP requests. Such MIB modules can be implemented fairly easily.

More commonly, the agent needs to provide an SNMP-based interface to information held elsewhere, perhaps in the operating system kernel or some other application. Handling this is much more complex - since a lot depends on what mechanisms are provided for retrieving (and possibly updating) this information. The mib2c tool can generate code for processing SNMP requests, based on some internal cache of management information, but it cannot help with populating this cache with the underlying data. That is up to the MIB implementer.


See the existing MIB modules in the Net-SNMP source tree for various examples of assorted approaches to this task.