JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Solaris System Management Agent Developer's Guide
search filter icon
search icon

Document Information

Preface

1.  Introduction to the System Management Agent

2.  Creating Modules

3.  Data Modeling

init_module Routine

Scalar Objects

demo_module_1 Code Example for Scalar Objects

Modifications for Scalar Data Retrieval

Simple Tables

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

General Tables

demo_module_3 Code Example for General Tables

4.  Storing Module Data

5.  Implementing Alarms

6.  Deploying Modules

7.  Multiple Instance Modules

8.  Long-Running Data Collection

9.  Entity MIB

10.  Migration of Solstice Enterprise Agents to the System Management Agent

A.  SMA Resources

B.  MIBs Implemented in SMA

Glossary

Index

init_module Routine

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:

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.