EMS Manual
Example of Retrieving Event Messages
EMS Manual—426909-005
A-9
TAL Source File
ZSPI^VAL^CMDHDR, ZEMS^CMD^CONTROL);
IF spi^err <> ZSPI^ERR^OK THEN
CALL DEBUG;
! Place the connect-source-collector token in buffer
spi^err := SSPUTTKN(spi^buf, ZEMS^TKN^CONNECT^SRC^COLL,
coll^name);
IF spi^err <> ZSPI^ERR^OK THEN
CALL DEBUG;
! Send the command message to the distributor
CALL send^spi^cmd;
END;
?PAGE
PROC spi^cmd^load^filter;
BEGIN
! This proc builds a command message that loads a filter
! into the distributor and passes one filter parameter
! Initialize spi^buf for distributor CONTROL message
spi^err := SSINIT (spi^buf, ZEMS^VAL^BUFLEN,
zems^val^ssid,
ZSPI^VAL^CMDHDR, ZEMS^CMD^CONTROL);
IF spi^err <> ZSPI^ERR^OK THEN
CALL DEBUG;
! Place the load-filter token in the buffer
spi^err := SSPUTTKN(spi^buf, ZEMS^TKN^FILTERFILE,
filt^name);
IF spi^err <> ZSPI^ERR^OK THEN
CALL DEBUG;
! Place the filter-parameter token in the buffer
spi^err := SSPUTTKN(spi^buf, MYAP^TKN^PARAM^CPU,
cpu^num, , myap^val^ssid);
IF spi^err <> ZSPI^ERR^OK THEN
CALL DEBUG;
! Send the command message to the distributor
CALL send^spi^cmd;
END;
?PAGE
PROC displ^event(event^buf);
INT .EXT event^buf;
BEGIN
INT(32) etxt^stat;
INT i;
! This procedure displays at your terminal the event
! message just retrieved.
!
! Generate display text from the event message