SNMP Subagent Programmer's Guide

Toolkit Components
1-2 119728SNMP Subagent Programmer’s Guide
Introduction to Subagent Programming
Tandem offers several subagents, such as the EMS Trap Subagent and the NonStop
NET/MASTER Trap Subagent. To facilitate the creation of subagents by customers
who want to instrument their own SNMP management capabilities, Tandem provides the
NonStop SNMP Subagent Toolkit. The Toolkit expedites the development of subagents
written in the C programming language that execute on and manage resources of a
Tandem NonStop system.
Toolkit Components
The Subagent Toolkit includes these components:
A MIB compiler, which compiles the subagent MIB definition into a C header file
containing definitions needed at run time.
Header files, which define data structures and logic needed at run time.
Two run-time libraries: one that generates trace messages for use during
debugging and one for production use. The MIB compiler output and header files
contain definitions that let subagents access the run-time library.
Sample subagent files, which illustrate how to encode MIBs and subagent logic to
handle certain SNMP operations.
How these components fit into the subagent development and usage cycles is the topic of
the remainder of this section.
Division of Responsibility
Figure 1-2 illustrates the division of responsibility between subagents developed using
the Toolkit and other SNMP components.
Manager Communication
The NonStop agent and the run-time library handle all the details of manager-subagent
message transfer. Therefore subagents developed using the Toolkit do not have to
encode manager communication logic. The subagent makes a simple call to the run-
time library provided with the Toolkit whenever it needs to invoke communication with
managers. The NonStop agent handles interactions with managers, and the run-time
library handles subagent-agent communications.
Object Management
The subagent is responsible for manipulating the objects that it makes visible to
managers. The subagent returns values for objects when Get requests arrive from
managers. The subagent changes object values when Set requests arrive. When events
that impact object management occur, the subagent can send an unsolicited message,
known as a “trap,to the manager.
Every subagent has a corresponding MIB. Objects the subagent grants manager access
to are defined in the MIB. The Toolkit’s MIB compiler uses the MIB definition to
generate code that both the subagent and the run-time library use. The manager uses the
MIB definition to identify objects to which it has access.