SNMP Configuration and Management Manual
NonStop NET/MASTER Trap Subagent
SNMP Configuration and Management Manual—424777-006
10-10
Modifying GENTRAP
Example 10-2. Initial Contents of GENTRAP (page 1 of 2)
gentrap: procedure nofold
/*
procedure: gentrap
synopsis: gentrap <snmp-agent-processname>
description:
This procedure is intended to be invoked from RMS. GENTRAP
assembles an SNMP trap from the EMS event and writes it to
the #TRAP interface of the specified SNMP agent.
The agent is specified as &1 on the "NCL Proc Name" field of
page 5 of RMS : System Action screen.
This procedure opens and closes the agent each time it is called.
To improve efficiency, the procedure could open the agent and set
a global flag first time it is called, then check the flag each
time to decide whether to open the agent or not.
This procedure assumes that the NCL variables for the event exist
and are set correctly. Do not run this procedure from an
environment that does not have the event (OCS, for example).
*/
%%include nnmtrap
&err = openagent(&1, myagt);
if &err \= 0 then do
say "error "&err" from openagent call. &sys.file.rc = ",
&sys.file.rc
say " &sys.file.error = "&sys.file.error
say " &sysmsg = "&sysmsg
flush;
end;
control shrvars=&trap.*
&trap.oid.1 = 1.3.6.1.4.1.169.3.12.1 ; /* SSID */
&trap.value.1 = &zzzmssid;
&trap.oid.2 = 1.3.6.1.4.1.169.3.12.2 ; /* event number */
&trap.value.2 = d2c(&$ems.spi.tandem.zems_tkn_eventnumber) ;