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.conf file (optional).

  • A call to config_parse_dot_conf() to explain to the .conf parser 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 ...

Get Practical VoIP Using VOCAL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.