SNMP Configuration and Management Manual

NonStop NET/MASTER Trap Subagent
SNMP Configuration and Management Manual424777-006
10-13
Trap Connections
return-code
is an integer describing the outcome of the function call. GENTRAP uses a
variable named &err to hold this value. The sendtrap return codes, their meanings,
and the actions taken by GENTRAP when they occur are described in Messages
on page 10-18.
The closeagent function terminates communication with the SNMP agent. It closes
an open instance created by openagent. This function accepts one argument and
returns an integer describing the outcome of the function call. The closeagent function
is invoked as follows:
file-id
is the file identifier you associated with the openagent operation. GENTRAP
assigns the name myagt.
return-code
is an integer describing the outcome of the function call. GENTRAP uses a
variable named &err to hold this value. The closeagent return codes, their
meanings, and the actions taken by GENTRAP when they occur are described in
Messages on page 10-18.
Trap Connections
Traps from the NonStop NET/MASTER Trap Subagent are routed to SNMP managers
identified in the SNMP agent’s TRAPDEST objects. Refer to Configuring Trap
Destinations on page 2-38 for more information on this subject.
Starting and Stopping the Subagent
To start the subagent, first start the SNMP agent as described in Section 2, Installing
and Configuring the SNMP Agent. Then invoke GENTRAP from EMSPROC or an
RMS message handler:
GENTRAP $agent-process
agent-process
is the name assigned to the agent process when it was started.
GENTRAP initiates communication with the SNMP agent by calling the openagent
function in NMMTRAP. After sending a trap, GENTRAP terminates communication with
the SNMP agent by calling the closeagent function in NMMTRAP.
return-code = closeagent (file-id)