SNMP Configuration and Management Manual
NonStop NET/MASTER Trap Subagent
SNMP Configuration and Management Manual—424777-006
10-11
Modifying GENTRAP
The openagent function sets up a user database (UDB) for the agent process. It 
accepts two arguments and returns an integer describing the outcome of the function 
call. The openagent function is invoked as follows:
SNMP-agent-process
is the name assigned to the agent process when it was started. GENTRAP passes 
the agent process name as a parameter (&1), assigned a value when GENTRAP 
starts.
 &trap.oid.3 = 1.3.6.1.4.1.169.3.12.3 ; /* standard content */
 &trap.value.3 = d2c(&$ems.tandem.spi.zems_tkn_content_standard) ;
 &trap.oid.4 = 1.3.6.1.4.1.169.3.12.4 ; /* value of subject token */
 &trap.value.4 = &zzzmsubject;
 &trap.oid.5 = 1.3.6.1.4.1.169.3.12.5 ; /* generating process */
 &trap.value.5 = &$ems.tandem.spi.zems_tkn_zems_tkn_proc_desc;
 &trap.oid.6 = 1.3.6.1.4.1.169.3.12.6 ; /* date & time */
 &trap.value.6 = &$ems.tandem.spi.zems_tkn_gentime ;
 /* YYYY/MM/DD HH:MM:SS.mmmmmm */
 &trap.oid.7 = 1.3.6.1.4.1.169.3.12.7 ; /* emphasis token */
 if &$ems.tandem.spi.zems_tkn_emphasis \= Y then
 &trap.value.7 = "(not critical)"
 else
 &trap.value.7 = "(CRITICAL)" ;
 &trap.oid.8 = 1.3.6.1.4.1.169.3.12.8 ; /* event text */
 &trap.value.8 = &zzzmsgtext ;
 &err = sendtrap(myagt, 6, 0, 8)
 /*zsmp-val-trap-enterpriseSpfc = 6
 trap type = 0
 OID count = 8 */
 if &err \= 0 then do
 say "error "&err" from sendtrap procedure. &sys.file.rc = ",
 &sys.file.rc
 say " &sys.file.error = "&sys.file.error
 say " &sysmsg = "&sysmsg
 end;
 &err = closeagent(myagt);
 if &err \= 0 then do
 say "error "&err" from closeagent procedure. &sys.file.rc = ",
 &sys.file.rc
 say " &sys.file.error = "&sys.file.error
 say " &sysmsg = "&sysmsg
 end;
end gentrap
return-code = openagent (SNMP-agent-process, file-id)
Example 10-2. Initial Contents of GENTRAP (page 2 of 2)










