1. Introduction to the System Management Agent
demo_module_1 Code Example for Scalar Objects
Modifications for Scalar Data Retrieval
demo_module_2 Code Example for Simple Tables
Modifications for Simple Table Data Retrieval
Data Retrieval From Large Simple Tables
Multiple SET Processing in demo_module_2
demo_module_3 Code Example for General Tables
8. Long-Running Data Collection
10. Migration of Solstice Enterprise Agents to the System Management Agent
When a module is loaded in the agent, the agent calls the init_module() routine for the module. The init_module() routine registers the OIDs for the objects that the module handles. After this registration occurs, the agent associates the module name with the registered OIDs. All modules must have this init_module() routine.
The mib2c utility creates the init_module() routine for you. The routine provides the basic code for data retrieval, which you must modify appropriately for the type of data.
If you have several MIB nodes in your MIB, the mib2c utility creates several .c files. Each generated file contains an init_mibnode() routine. A module must have only one initialization routine, which must conform to the convention of init_module(). Therefore, when you have more than one MIB node represented in your module, you must combine the initialization content of all the generated .c files into one file to ensure that the initialization routine for each MIB node is called by init_module().
You can combine files to build a module in one of the following ways:
Create a module file to call all the initialization routines.
With this approach, the routine init_myMib() in myMib.c might look similar to the following pseudo code:
#include "scalarGroup.h" #include "tableGroup.h" ... init_myMib() { init_scalarGroup(); init_tableGroup(); }
where init_scalarGroup() and init_tableGroup() are in different files.
Combine the initialization routines' code into one initialization routine.
If you used this approach, the routine init_myMib() might be similar to the following pseudo code:
init_myMib() { <init code - scalarGroup> /* found in scalarGroup.c */ <init code - tableGroup> /* found in tableGroup.c */ }
In both cases, the rest of the code in myMib.c might be similar to the following pseudo code:
/* get/set handlers for scalarGroup found in scalarGroup.c */ /* get_first/get_next/handler for tableGroup - found in tableGroup.c */
The following sections discuss how the data retrieval code must be modified in your module for different types of data.