SNMP Subagent Programmer's Guide

System Time Manager
2-70 119728SNMP Subagent Programmer’s Guide
Programming Tutorials
System Time Manager
This subagent illustrates how to encode Get, Test, and Set operations in what are known
as “access functions,” which contain logic for retrieving or changing MIB object values.
In some cases, you can rely on the access functions GDMOC generates to retrieve and
change MIB object values. In other cases, however, you need more control over the
logic that is executed when MIB values are manipulated. For example, GDMOC
generates Test functions for writable MIB objects based on the syntax attributes you
assign those objects in your MIB definition. If you need to perform more extensive
testing before the Set operation is performed, you must encode your own access
functions:
The System Time Manager subagent needs access functions that support changing the
value of the system clock. The Test function performs some editing on the input value
and converts the value into the format required by the Guardian procedure used to make
the change (SETSYSTEMTIME). The Set function calls SETSYSTEMTIME to change
the system time if the Test function completes successfully.
To expedite encoding access functions, you can run GDMOC using as input your MIB
definition, minus the extensions that identify access functions. The access functions
GDMOC generates can be used as templates for your own access logic. To prepare the
final header file, add appropriate extensions to the MIB definition to identify your access
functions, and rerun GDMOC.
These files are related to System Time Manager:
Functions
Invoke System Time Manager by specifying the executable subagent name and a
NonStop agent process name:
RUN SYSTIME /NAME $STIME/ $ZSNMP
The subagent waits until an SNMP request arrives, then processes the request. A
manager can execute Get operations to retrieve the current system time. When the
subagent process is started by a member of the super group (user ID 255,n), a manager
can also change the system time.
read-only objects Require a Get function.
read-write objects Require a Get function for read operations and Test and Set
functions for write operations. The Test function determines
whether the Set function should be called, and the Set function
changes the value of a MIB object.
systimec C source code for main control block
accessfc C source code for access functions
systmsmi MIB definition
systimem TACL routine