Example

An example is provided to help you understand how to use the DEFRULE command, and shows the typical results of this command.

Example 1: Use the DEFRULE command to create a rule (SAMPLE2) to test for a match for ‘*SESS*’ in messages for user TS3163.

The example below shows that action RTEST is to be taken when the criteria for DEFRULE are met.

Figure 1. DEFRULE command issued with DEFACTN command
GOMCMD OPMGRM1 DEFACTN NAME RTEST COMMAND 'CP MSG TS3163 HELLO WORLD' ENV LVM                                         
Ready; T=0.01/0.01 04:42:49                                                     
GOMCMD OPMGRM1 DEFRULE NAME SAMPLE2 MATCH '*SESS*' ACTION RTEST USER TS3163  
Ready; T=0.01/0.01 04:44:43  

When any text containing the string ‘*SESS*’ appears on the console of TS3163, the action RTEST gets triggered and the message (below) is displayed on the TS3163 console.

Figure 2. Message displayed on console
09:50:57 * MSG FROM OPMGRM1 : HELLO WORLD

Example 2: Use the DEFRULE command to create a rule (RULE1) to test for a match for ‘*MACHINE*’ in a message being written to the Operations Manager log and set the masking count to three to mask the next three lines after the matching line.

GOMCMD OPMGRM1 DEFACTN NAME ACT1 COMMAND ‘CP MSG MAINT720 LINE MASKED!!’ ENV LVM 
Ready; T=0.01/0.01 08:11:30                                                     
GOMCMD OPMGRM1 DEFRULE NAME RULE1 MATCH '*MACHINE*' ACTION ACT1 MASKNEXT 3      
Ready; T=0.01/0.01 08:11:43      

The Operations Manager log will contain the following.

07/18/22 08:15:18 GOMCMD0216L  TS3159   "07/18/22 08:15:18 GOMCMD0902I  0 MACHINE MONITOR(S) DEFINED" VID=*MSG     SRC=MASIUCV  CLS= 
07/18/22 08:15:18 GOMCMD0216L  TS3159   "********************************************************************" VID=*MSG     SRC=MASC 
07/18/22 08:15:18 GOMCMD0216L  TS3159   "****************************************************" VID=*MSG     SRC=MASIUCV  CLS=8       
07/18/22 08:15:18 GOMCMD0216L  TS3159   "**************************************************" VID=*MSG     SRC=MASIUCV  CLS=8         
07/18/22 08:15:18 GOMCMD0216L  TS3159   "07/18/22 08:15:18 GOMCMD0905I  0 ACTION(S) SCHEDULED FOR PROCESSING" VID=*MSG     SRC=MASIU 
07/18/22 08:15:18 GOMCMD0216L  TS3159   "07/18/22 08:15:18 GOMCMD0906I  2 GROUP(S) DEFINED" VID=*MSG     SRC=MASIUCV  CLS=8          
07/18/22 08:15:18 GOMCMD0216L  TS3159   "07/18/22 08:15:18 GOMCMD0907I  0 DATES(S) DEFINED" VID=*MSG     SRC=MASIUCV  CLS=8          

Example 3: Use the DEFRULE command to create a rule (RULE1) to test for a match for ‘*MACHINE*’ in a message being written to the Operations Manager log and set the masking count to three to mask the next three lines. Use DEFACTN INPUT MSK to define an action which will mask the matching line upon triggering the rule.

GOMCMD OPMGRM1 DEFACTN NAME ACT1 COMMAND ‘CP MSG MAINT720 LINE MASKED!!’ ENV LVM INPUT MSK   
Ready; T=0.01/0.01 08:17:26                                                                 
GOMCMD OPMGRM1 DEFRULE NAME RULE1 MATCH '*MACHINE*' ACTION ACT1 MASKNEXT 3                  
Ready; T=0.01/0.01 08:17:40                                                                 

The Operations Manager log will contain the following.

07/18/22 08:18:22 GOMCMD0216L  TS3159   "***********************************************************" VID=*MSG     SRC=MASIUCV  CLS= 
07/18/22 08:18:22 GOMCMD0216L  TS3159   "********************************************************************" VID=*MSG     SRC=MASC 
07/18/22 08:18:22 GOMCMD0216L  TS3159   "****************************************************" VID=*MSG     SRC=MASIUCV  CLS=8       
07/18/22 08:18:22 GOMCMD0216L  TS3159   "**************************************************" VID=*MSG     SRC=MASIUCV  CLS=8         
07/18/22 08:18:22 GOMCMD0216L  TS3159   "07/18/22 08:18:22 GOMCMD0905I  0 ACTION(S) SCHEDULED FOR PROCESSING" VID=*MSG     SRC=MASIU 
07/18/22 08:18:22 GOMCMD0216L  TS3159   "07/18/22 08:18:22 GOMCMD0906I  2 GROUP(S) DEFINED" VID=*MSG     SRC=MASIUCV  CLS=8          
07/18/22 08:18:22 GOMCMD0216L  TS3159   "07/18/22 08:18:22 GOMCMD0907I  0 DATES(S) DEFINED" VID=*MSG     SRC=MASIUCV  CLS=8          
07/18/22 08:18:22 GOMCMD0216L  TS3159   "07/18/22 08:18:22 GOMCMD0908I  0 SPOOL MONITOR(S) DEFINED" VID=*MSG     SRC=MASIUCV  CLS=8