SNMP Subagent Programmer's Guide

Programming Tutorials
SNMP Subagent Programmer’s Guide—119728 2-57
Indexed Trap Generator
Indexed Trap Generator
This subagent illustrates how to generate a trap containing three variable bindings: a
card number, a port number, and a computed ratio of the two numbers. These three
variables constitute one entry in a static table that the subagent builds upon startup.
The index to each entry is a combination of its associated card number and port number.
When the user enters a card and port number combination that matches an existing index
value, Indexed Trap Generator sends a trap containing the values in the entry.
This subagent also handles Get and GetNext operations on the table and several other
MIB objects. It provides locator and next functions to help the run-time library find
individual table entries.
These files are related to Indexed Trap Generator:
Functions
Invoke Indexed Trap Generator by specifying the executable subagent name and a
NonStop agent process name:
RUN TBLTRAP /NAME $TRGEN/ $ZSNMP
The subagent blocks until the NonStop agent indicates that object registration is
complete. Then the subagent prompts the user for input at a terminal:
To cause a trap, enter card, port:
If the card and port number constitute a valid index into the table, Indexed Trap
Generator generates a trap, then processes any pending SNMP requests before re-
prompting for input. If the index value does not exist, the subagent processes any
pending request, then re-prompts the user for input.
This subagent supports the following SNMP requests for its MIB objects:
tbltrapc C source code
tbltrsmi MIB definition
tbltrapm TACL routine
tblTrapCards Get
tblTrapPorts Get
tblTrapTableEntry Get and GetNext