SNMP Configuration and Management Manual
NonStop NET/MASTER Trap Subagent
SNMP Configuration and Management Manual—424777-006
10-12
Modifying GENTRAP
file-id
is the file identifier you associate with the open 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 openagent return codes, their
meanings, and the actions taken by GENTRAP when they occur are described in
Messages on page 10-18.
The sendtrap function assembles the trap and writes it to the SNMP agent. In this
function, all trap MIB values are assumed to be strings. The function accepts four
arguments and returns an integer describing the outcome of the function call. The
sendtrap function is invoked as follows:
file-id
is the file identifier you associated with the openagent operation. GENTRAP
assigns the name myagt.
generic-trap
is an integer identifying one of the standard trap types. Valid values are:
2 (linkDown)
3 (linkUp)
4 (authenticationFailure)
5 (egpNeighborLoss)
6 (enterpriseSpecific)
GENTRAP passes the value 6 to identify the trap as an enterprise-specific trap.
specific-trap
is a code indicating more specifically the nature of the trap. GENTRAP assigns the
value 0.
OID-count
is an integer specifying the number of object identifiers to append. GENTRAP
assigns the value 8 because there are 8 objects in the EMS Trap MIB. The size of
the (non-BER-encoded) trap is limited to 1500 bytes.
return-code = sendtrap (file-id, generic-trap, specific-trap,
OID-count)