SNMP Subagent Programmer's Guide
Dynamic Directory Program
2-44 119728—SNMP Subagent Programmer’s Guide
Programming Tutorials
Dynamic Directory Program
This subagent enhances Static Directory to manage a dynamic table. The static table
managed by Static Directory does not reflect changes to the file content of the
subvolume during the time the subagent is executing. If a file is added or deleted or
renamed after the subagent is started, the table does not reflect these changes.
A dynamic table contains entries whose number can vary and whose values can vary
while the subagent is executing. Therefore the table needs to be rebuilt each time an
SNMP request is received.
To avoid the overhead of re-registering each entry every time an SNMP request is
received, this subagent registers only the table. Because rows are not individually
registered, the subagent needs to provide two functions to assist the run-time library in
locating entries:
An alternative approach is to deregister and re-register each entry every time the table is
rebuilt. While this approach may be reasonable for small tables, the overhead associated
with frequent re-registration may not be efficient in all cases, as when manager access to
the table is frequent. When this inefficiency can be tolerated, however, the alternative
approach is simpler, because you do not encode locator and next functions. Refer to
Section 4, “Writing Subagent Logic,” for more information on next and locator
functions.
These files are related to Dynamic Directory:
Functions
Invoke Dynamic Directory by specifying the executable subagent name and a NonStop
agent process name:
RUN DYNAMLS /NAME $DYNAM/ $ZSNMP
Dynamic Directory initially makes available for read access all files associated with the
subvolume named zsnmpsdk. The subagent lets managers change the subvolume name
so that files in other subvolumes are visible. Whenever the subagent receives an SNMP
request, build_files() is called to rebuild the table to reflect the files associated at the
time with the most recently defined subvolume.
locator function A function that finds an entry when Get and Set requests arrive
next function A function that, in conjunction with the locator function, finds an
entry when GetNext requests arrive
dynamlsc C source code
dirC C source code
dirH C source code
dynamsmi MIB definition
dynamlsm TACL routine