Examples
An example is provided to help you understand how to use the DEFEMON command, and shows
the typical results of this command. Events from the CP system service, *VMEVENT
,
are captured and compared against defined event monitors. If conditions for the event monitor are
met, the associated action is scheduled for processing.
Example 1: Use the DEFEMON command to define an event monitor named EMONITOR.
In the example below, an event monitor is defined for user TS3163 with a TYPE 1 event, which is a "LOGOFF" event. When user ID TS3163 logs off, an action named SAMPLE is triggered, which will issue a message “ USER ID TS3163 IS LOGGED OFF” on the MAINT640 screen.
GOMCMD OPMGRM1 DEFACTN NAME SAMPLE COMMAND 'CP MSG MAINT640 USER ID TS3163 IS LOGGED OFF' ENV LVM
Ready; T=0.01/0.01 02:17:24
GOMCMD OPMGRM1 DEFEMON NAME EMONITOR TYPE 1 USER TS3163 ACTION SAMPLE
Ready; T=0.01/0.01 02:17:53
MAINT640 AT ZVM6KT02 VIA * 09/16/19 02:18:57 CDT MONDAY
Ready; T=0.01/0.01 02:18:57
02:19:03 * MSG FROM OPMGRM1 : USER ID TS3163 IS LOGGED OFF
Example 2: Use the DEFEMON command to define an event monitor, EVENTMON, using TYPE 0.
In the example below, an event monitor is defined for user MAINT640 with a TYPE 0 event, which is a "LOGON" event. When user MAINT640 logs on to the system, an action named SAMPLE is triggered, which will issue a message “ USER ID MAINT640 HAS LOGGED ON SUCCESSFULLY” to the user TS3163.
GOMCMD OPMGRM1 DEFACTN NAME SAMPLE COMMAND 'CP MSG TS3163 USER ID MAINT640 HAS LOGGED ON SUCCESSFULLY' ENV LVM
Ready; T=0.01/0.01 03:53:43
GOMCMD OPMGRM1 DEFEMON NAME EVENTMON TYPE 0 USER MAINT640 ACTION SAMPLE
Ready; T=0.01/0.01 03:54:49
03:55:02 * MSG FROM OPMGRM1 : USER ID MAINT640 HAS LOGGED ON SUCCESSFULLY