Solaris System Management Agent Developer's Guide

Chapter 1 Introduction to the System Management Agent

The System Management Agent is a Simple Network Management Protocol (SNMP) agent. This chapter contains the following topics:

Overview of SNMP Agents

SNMP uses the term manager for the client application that accesses the data about a managed device or system. The manager usually runs on a system that is different from the managed system. The term agent is used for the program that implements the protocol stack for servicing the requests from the manager. The SNMP agent typically runs on the managed device. The agent offers services on a designated TCP/IP port. The default SNMP port is 161.

Information about the target device is contained in a Management Information Base (MIB). MIBs are used by agents and managers so that both programs have knowledge of the data available. The MIB tells the manager about the device's functions and data. The MIB also tells the manager how to address or access that information in the form of managed objects. To access this management information, the manager issues requests to the agent. The requests contain identifiers for the MIB's data objects that are of interest to the manager. If the request can be successfully completed, the agent returns a response that contains the values for the required data objects.

Most SNMP agents support the basic SNMP protocol stack, and some minimal MIBs. However, to make management of a device more effective, additional MIBs must be supported on the managed device. The additional MIBs are provided by device vendors to provide management information about custom features of the managed device.

A MIB that is added to an SNMP agent is commonly known as an extension because the MIB extends the capabilities of the agent. An agent that can accept extensions is extensible. The System Management Agent (SMA), described in this manual, is an extensible agent. The extensions to the System Management Agent are called extension modules.

Overview of the System Management Agent

The System Management Agent (SMA) is an SNMP agent that is based on an open source project, Net-SNMP at http://www.net-snmp.org. This base agent supports SNMPv1, v2c, and v3 protocols.


Note –

The Net-SNMP version used in SMA is 5.0.9.


The following diagram shows the structure of the Net-SNMP agent, and is followed by an explanation of the components.

Figure 1–1 Net-SNMP Architecture

Diagram shows communication flow between the components
of the Net-SNMP master agent.

The components of the Net-SNMP agent are:

Extending the Agent

The Net-SNMP agent can be extended in the following ways:


Note –

The System Management Agent supports module deployment in the form of dynamically loaded modules or subagents. The agent also provides a proxy mechanism. You cannot recompile the System Management Agent.


See Chapter 6, Deploying Modules for information about how to deploy modules as dynamic modules and in subagents.

Features Added in System Management Agent

The SMA product includes the Net-SNMP agent, Net-SNMP developer tools, and Net-SNMP API libraries that enable the agent to be extended through modules. You can use the tools and APIs to create a module to support the custom features of a managed device. A management program can then be used for monitoring and managing the device.

The SMA extends the Net-SNMP agent to support the following MIBs:

Support for these MIBs is provided as static modules that run in the SMA agent. The agent was created by recompiling the Net-SNMP agent to include these modules.

The SMA provides an additional MIB for hardware, the Entity MIB, in an external dynamically loaded module. The Entity MIB is described in RFC 2737 at http://www.ietf.org/rfc/rfc2737.txt. The Entity MIB is implemented as a skeleton MIB, so that module developers can populate the various tables of the MIB. The Entity MIB can be used by a single agent for managing multiple logical entities and physical entities. For more information about the Entity MIB, see Chapter 9, Entity MIB.

Contents of the SMA for Developers

SMA includes the following content for developers:

In addition, you can install the SUNWsmaS package, which contains the source code for Net-SNMP. See the Solaris System Management Agent Administration Guide for installation instructions.

File Locations of Developer Files

The developer files are installed in the locations that are shown in the following table.

Table 1–1 File Locations for Developer Content

Directory 

Developer Content 

/usr/demo/sma_snmp

Sample modules for demonstration purposes. See Demonstration Modules for more information.

/usr/sfw/bin

Command line tools that are useful for developers. For more information on these tools, see SMA Tools.

/usr/sfw/sbin

Executable files for the snmpd agent daemon and snmptrapd trap daemon, which provide the SNMP services.

/usr/sfw/lib

The 32-bit shared libraries that contain the API functions from Net-SNMP, and the libentity.so library, which defines functions for using the Entity MIB.

This directory is supplied on all Solaris platforms. See API Libraries for more information.

/usr/sfw/lib/sparcv9

The 64-bit shared libraries that contain the API functions from Net-SNMP, and the libentity.so library, which defines functions for using the Entity MIB.

This directory is supplied only on 64-bit Solaris on SPARC® platforms. See API Libraries for more information.

/usr/sfw/include

Header files needed by API libraries. 

/usr/sfw/doc/sma_snmp/html

HTML documentation for Net-SNMP API functions. 

/etc/sma/snmp

Configuration files that are used by the mib2c tool.

/etc/sma/snmp/mibs

The MIBs supported by the System Management Agent. 

/usr/perl5/vendor_perl/5.8.3/sun4-solaris-64int

Perl modules needed by the mib2c tool.

/usr/share/sma_snmp

Source code for Net-SNMP. The code is provided in the SUNWsmaS package, which is not installed by default during Solaris installation. The package must be installed manually from the Solaris media. For instructions for installing the SUNWsmaS package, see the Solaris System Management Agent Administration Guide.

SMA Tools

The SMA includes many command-line tools, which are described in the sma_snmp(5) man page.

Each tool has an associated man page. Links to all the man pages for the product are included in Appendix A, SMA Resources. The tools are located in /usr/sfw/bin.

The snmp commands can be used to query the agent to test your modules. Read the man pages for detailed usage information.

API Libraries

The following API libraries are included with the SMA product:

The libentity library is not part of Net-SNMP, but is a customization for the SMA product.

On SPARC platforms, the 32–bit Net-SNMP libraries are contained in the /usr/sfw/lib directory. The 64–bit Net-SNMP libraries are contained in the /usr/sfw/lib/sparcv9 subdirectory.

On x86 platforms, only the 32–bit Net-SNMP libraries are available in the /usr/sfw/lib directory.

The functions contained in the Net-SNMP libraries are used in the MIB modules that you create, as well as in the agent. Documentation from Net-SNMP for using the API functions is contained in /usr/sfw/doc/sma_snmp/html.

The SMA includes the same Net-SNMP API functions that are available with the open source Net-SNMP agent. API Functions includes a list of functions that are certified to work with the System Management Agent.

Demonstration Modules

The /usr/demo/sma_snmp directory contains several demonstration modules. The demo modules illustrate methods for creating modules to solve various kinds of information-gathering problems. Later chapters in this manual discuss the demo modules in detail. The following table lists and describes the demo modules. The table also provides cross-references to the sections that discuss the demos.

Table 1–2 Descriptions of Demonstration Modules

Module Name 

Demonstrates 

Discussed in Section 

demo_module_1

Data modeling for scalar objects 

Scalar Objects

demo_module_2

Data modeling for a simple table with writable objects 

Simple Tables

demo_module_3

Data modeling for a general table 

General Tables

demo_module_4

Implementing alarms 

demo_module_4 Code Example for Alarms

demo_module_5

Persistence of module data across agent restarts 

demo_module_5 Code Example for Persistent Data

demo_module_6

Running multiple instances of a module on a single host 

Implementing Multiple Instances of a Module

demo_module_7

Dynamically updating multi-instance modules 

Enabling Dynamic Updates to a Multiple Instance Module

demo_module_8

Implementing a module as an AgentX subagent 

Deploying a Module as a Subagent

demo_module_9

Implementing objects that wait for external events without blocking the agent 

SNMP Alarm Method for Data Collection

demo_module_10

Module design that handles long running data collections so that their values can be polled by an SNMP manager 

SNMP Manager Polling Method for Data Collection

demo_module_11

How to use the Entity MIB API functions 

SMA Entity MIB Implementation

demo_module_12

How use Solstice Enterprise Agents code templates and SMA code templates to help re-implement Solstice Enterprise Agents subagents as SMA modules 

Migrating Solstice Enterprise Agent Subagents to SMA

Technical Support for Developers

Technical support for developers of modules for the System Management Agent is provided through the Net-SNMP open source community at http://www.net-snmp.org. You might find the developers discussion mailing list net-snmp-coders@lists.sourceforge.net to be helpful. An archive for the mailing list is located at http://sourceforge.net/mailarchive/forum.php?forum_id=7152.