SNMP Configuration and Management Manual

EMS Trap Subagent
SNMP Configuration and Management Manual424777-006
9-11
The Trap PDU
Example 9-3. Example TACL Macro for Starting EMS Trap Subagent
?tacl routine
==
== routine: MYMACRO
==
== synopsis: MYMACRO <SNMP-agent-process>
==
== example: MYMACRO $ZSNMP
==
== description: MYMACRO opens the SNMP agent process and
forwards
== from $0 as SNMP traps all EMS events that pass the filter
== MYFILTER
==
#frame
#push :agent^process
[#if [#argument /value :agent^process/ processname]]
[#if "[#deviceinfo /devicetype, subtype/ [:agent^process]]"
'<>' "31 30" |then|
#output expected the process name of an SNMP agent
#unframe
#return
]
[#if [#definedelete =_snmp_agent]]
add define =_snmp_agent, file [:agent^process].#trap
emsdist /nowait, name/ type printing, filter myfilter, &
collector $0, gmt on
#output EMS event subagent process started; process name is
[#process].
#output Type STOP [#process] to stop sending EMS events as
traps.
#pop :agent^process
[#if [#definedelete =_snmp_agent]]
#unframe