Using EMS
Using Programmatic Interfaces
107365 Tandem Computers Incorporated
7–15
Figure 7-3. Generating an EMS Event (Page 3 of 3)
== Main logic
==================================================
#SET collector $0
#SET action_id 0
== Open the Collector for WRITEREADs; $0 expects a WRITEREAD
#SET evt_error [#REQUESTER /WAIT/ READ [collector] &
req_error req_read req_prompt]
== If open fails, display an error message. Otherwise send
== an event message.
[#IF [evt_error] |THEN|
#OUTPUT *ERROR* #REQUESTER OPEN error [evt_error]
| ELSE |
[#CASE %1%
|1|
build_evt 9997 0 0 Test: Calm event
|2|
build_evt 9998 -1 0 Test: Action event
|3|
build_evt 9997 0 -1 Test: Critical event
|OTHERWISE|
#OUTPUT Invalid argument. Must be:
#OUTPUT 1 (event),
#OUTPUT 2 (action event), or
#OUTPUT 3 (critical event).
]
]
== Close the Collector
#SET evt_error [#REQUESTER /WAIT/ close req_read]
[#IF [evt_error] |THEN|
#OUTPUT *ERROR* #REQUESTER CLOSE error [evt_error]
]
#UNFRAME