When Event Management invokes a command or script as a result of a COMMAND or UNIXCMD action, the new process is created with a list of new environment variables that contain information about the event. Programs, Windows BAT files, or UNIX shell scripts can reference these variables, but the variables cannot be altered.
|
Variable |
Description |
|---|---|
|
EVENT_CATEGORY |
CATEGORY field from the event |
|
EVENT_DATEGEN |
Date (yyyy/mm/dd) the event was generated |
|
EVENT_DEVICE |
Device associated with the event |
|
EVENT_JOBNAME |
Event job name (if from a Workload job) |
|
EVENT_JOBNO |
Event job number (if from a Workload job) |
|
EVENT_JOBQUAL |
Event job qualifier (if from a Workload job) |
|
EVENT_JOBSET |
Event jobset (if from a Workload job) |
|
EVENT_LOGRECID |
Identification (ID) of the last record logged when the command is invoked (possibly the current event if it is not suppressed) |
|
EVENT_MSGNUM |
MESSAGE NUMBER field from the event |
|
EVENT_NODEID |
Node of origin associated with the event |
|
EVENT_OPUSER |
User name under which Enterprise Management is processing this message action |
|
EVENT_PID |
ID (decimal) of the process that generated the event |
|
EVENT_PROGRAM |
Program that generated the event (for example, cawto.exe) |
|
EVENT_REPLID |
Reply ID returned if the event was write-to-operator with reply (WTOR) |
|
EVENT_SEQNO |
Sequence number of the action that invoked this command |
|
EVENT_SEVERITY |
Event severity |
|
EVENT_SOURCE |
Event source |
|
EVENT_STATION |
Event station |
|
EVENT_TAG |
Platform tag associated with the event (WNT, HPUNIX, and so on) |
|
EVENT_TEXT |
Full text of the event |
|
EVENT_TIMEGEN |
Time (hh:mm:ss) the event was generated |
|
EVENT_TIME8 |
Time (hh:mm:ss) the command was invoked |
|
EVENT_TOKEN |
Token number of message record that matched this action |
|
EVENT_TYPE |
Type of event: MSG, CMD, REPLY, or WTOR |
|
EVENT_UDATA |
User data (value of the CA_UDATA environment variable when the event was generated) |
|
EVENT_USERID |
User of origin associated with the event |
|
EVENT_YYYYMMDD |
Date the command was invoked |
Example:
The command file in the following submitted job definition references variables:
define msgrec msgid=* scantext=*error*
define msgact name=(*,100)
action=commandtext=logerr.cmd
The logerr.cmd file contains:
@echo off
Rem This command file is invoked from Event
Rem Management action to log some event data to a
Rem file.
Rem The %EVENT_..% variables contain values from the
Rem event that invoked the action.
echo LOG,%EVENT_YYYYMMDD%,%EVENT_TIME8%,%EVENT_NODEID%,\
%EVENT_USERID%,%EVENT_TEXT% >>c:\temp\err.log
|
Copyright © 2014 CA Technologies.
All rights reserved.
|
|