Creating New Agent Code
This section explains how to work with your code.
Agent Extensibility
The agent that comes with this package is extensible through use of shell scripts and other methods. See the configuration manual pages (like SNMPd.conf) and the EXAMPLE.conf file for details.
You can also extend the agent by writing C code directly. The agent is extremely modular in nature and you need only create new files, reconfigure, and recompile. No modifications of the distributed source files are necessary. For details on how to go about this, see: http://www.csc.liv.ac.uk/~daves/Misc/UCD/guide.html, agent/mibgroup/examples/example.c, and agent/mibgroup/examples/example.h. Also, see the local/mib2c program and its readme file for help in turning a textual MIB description into a C code template.
example.h: Interface Information
The following are the requirements for the example.h file:
Declaration of the initialization function init_example (optional).
Declaration of the function(s) for retrieving variable information (
var_example).Declaration of the function(s) for setting variable information (if appropriate).
Declaration of the function(s) for parsing the
SNMPd.conffile (optional).A call to
config_parse_dot_conf()to explain to the.confparser which tokens we want to parse (optional).Definitions of the MIB group magic numbers declarations of the public functions.
A list of the variables in the group, including type information, mapping between magic numbers and OID subidentifiers within ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access