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

4.  Storing Module Data

About Storing Module Data

Configuration Files

Defining New Configuration Tokens

Implementing Persistent Data in a Module

Storing Persistent Data

Reading Persistent Data

demo_module_5 Code Example for Persistent Data

Storing Persistent Data in demo_module_5

Reading Persistent Data in demo_module_5

Using SNMP_CALLBACK_POST_READ_CONFIG in demo_module_5

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

About Storing Module Data

You might want your module to store persistent data. Persistent data is information such as configuration settings that the module stores in a file and reads from that file. The data is preserved across restarts of the agent.

Modules can store tokens with assigned values in module-specific configuration files. A configuration file is created manually. Tokens can be written to the file or read from the file by a module. The module registers handlers that are associated with the module's specific configuration tokens.

Configuration Files

The snmp_config(4) man page discusses SNMP configuration files in general. The man page documents the locations where the files can be stored so the agent can find the files. These locations are on the default search path for SNMP configuration files.

For your modules, the best location to store configuration files is in a $HOME/.snmp directory, which is on the default search path. You can also set the SNMPCONFPATH environment variable if you want to use a non-default location for configuration files.

When you create your own configuration file, you must name the file module.conf or module.local.conf. You must place the file in one of the directories on the SNMP configuration file search path.


Note - You might find that the Net-SNMP routines write your module's configuration file to the /var/sma_snmp directory. The routines make updates to that version of the file. However, the routines can find the configuration file in other locations when the module needs to initially read the file.


Defining New Configuration Tokens

Configuration tokens are used by modules to get persistent data during runtime. When your module uses custom configuration tokens, you should create one or more custom configuration files for the module. You might also choose to create one configuration file for several related modules. You can define new tokens in the custom configuration file.

Custom tokens must use the same format as the directives in snmpd.conf. One token is defined in each line of the configuration file. The configuration tokens are written in the form:

Token Value

For example, your token might be:

my_token 4

Modules should not define custom tokens in the SNMP configuration file, /etc/sma/snmp/snmpd.conf. If a module stores tokens in /etc/sma/snmp/snmpd.conf, namespace collisions can potentially occur. See Avoiding Namespace Collisions for more information about namespace collisions.