Previous Topic: Options for Initializing Desired StatesNext Topic: Understanding Transient Resource States


Rules to Maintain Current State Values

After you set the values in the DESIRED_STATE columns of your resource tables and SSM dispatches the correct action to get the resource into its desired state, the rules processing (another key element of SSM) takes over.

rules packets

Used by SSM to maintain the current state for resources it manages.

These rules packets intercept messages and update the CURRENT_STATE column using ADDRESS SQL. The rules intercept messages and update the current state of resources as indicated by the message content. A rules packet is a set of rules that work together to perform a common goal. An SSM rules packet might handle all of the messages that pertain to a single resource. For example, the )MSG rule SSMJES2, which is part of SSM, responds to all the $HASP messages that indicate a state change for JES2.

The messages are:

If the SSMJES2 rule was written as four independent )MSG rules that handle the same messages, then it would still be considered a rules packet.

A rules packet is a logical concept, not a physical entity. When a rules packet is comprised of multiple rules, nothing physically binds the rules together. Rules react to messages that a resource generates and set the CURRENT_STATE value of the resource so when:

The OPS.CCLXRULM library on the CA OPS/MVS distribution media contains a number of sample rules packets for started tasks and sample OPS/REXX programs, including the SSMCAAPI rule that processes events from the API interface.

The API interface of CA OPS/MVS lets participating CA products generate common current state APIs. This action allows for a single AOF rule, such as the SSMCAAPI rule, to set the CURRENT_STATE of such CA products accordingly within an SSM table. This rule eliminates enabling and maintaining a unique SSM rule packet to monitor each different CA product. The CASTATE API events are similar to the following events:

Note: To determine if it is generating CASTATE API events to CA OPS/MVS, see the documentation of the specific CA product that is being added to SSM. If it is, then a unique SSMxxxx rule packet is not needed to monitor its state within SSM (only need SSMCAAPI rule enabled). You can determine this activity easily by ensuring that the CA OPS/MVS APIACTIVE and BROWSEAPI parameters are set to YES before the CA product starts, and then viewing the CA OPS/MVS OPSLOG looking for a CASTATE API event (OPSLOG PROFILE for MSGID=CASTATE) that the CA product generates.

We test each sample rule and OPS/REXX program to ensure that any changes to the state of a resource are represented accurately. However, message identifiers can change, which can affect the operation of sample rules or OPS/REXX programs. If you notice a change in operation, notify CA Customer Support.

Important! If you want to modify a sample rule or OPS/REXX program to meet the needs of your site, we strongly recommend that you make a copy of the rule or OPS/REXX program and modify the copy. Do not make changes to the original sample rule or program. If you think that your modification would be of interest to other SSM users, contact CA Customer Support.

Your contributions to state rules are encouraged. If you have created an SSM rule or OPS/REXX program that manages the started task of a vendor-supplied product, contact CA Customer Support, who will determine whether your rule or program should be included in a future release of CA OPS/MVS. For assistance, contact Customer Support at http://ca.com/support.

The sample code that follows shows you a sample rules packet:

)MSG DFH*
)PROC
/*********************************************************************/
/*                                                                   */
/*            PROPRIETARY AND CONFIDENTIAL INFORMATION               */
/*                AND INTELLECTUAL PROPERTY OF CA.                   */
/*            Copyright (C) 2009 CA. ALL RIGHTS RESERVED.            */
/*                                                                   */
/*   NAME       - SSMCICS                                            */
/*   PURPOSE    - Set the current state of CICS regions based on     */
/*                message traffic.                                   */
/*   RELATED    - STATEMAN                                           */
/*   GLOBALS    - None                                               */
/*   PARMS      - None                                               */
/*   KEYWORDS   - None                                               */
/*   LANGUAGE   - OPS/REXX                                           */
/*   HISTORY    - 27 APR 2009 GEM  - Original implementation         */
/*                                                                   */
/*   NOTES      -                                                    */
/*                                                                   */
/*********************************************************************/
If Opsinfo('EXITTYPE') ^== 'MVS' Then Return                          
job   = msg.jobname                                                   
msgid = msg.id                                                        
Select                                                                
/*-------------------------------------------------------------------*/
/* DFHSI1500 applid element startup is in progress for CICS ...      */
/*--+----1----+----2----+----3----+----4----+----5----+----6----+----*/
  When msgid == 'DFHSI1500' then                                      
    If wordpos('startup is in progress',msg.text) > 0 then            
      Address SQL "Update STCTBL set current_state='STARTING'",       
                     "where jobname=:job and type='CICS'"             
/*-------------------------------------------------------------------*/
/* DFHSI1517 applid Control is being given to CICS                   */
/*--+----1----+----2----+----3----+----4----+----5----+----6----+----*/
  When msgid == 'DFHSI1517' then                                      
      If wordpos('Control is being given to CICS',msg.text) > 0 then  
        Address SQL "Update STCTBL set current_state='UP'",           
                       "where jobname=:job and type='CICS'"           
/*-------------------------------------------------------------------*/
/* DFHTM1715 applid product is being quiesced by userid ...          */
/*--+----1----+----2----+----3----+----4----+----5----+----6----+----*/
  When msgid == 'DFHTM1715' then                                      
    Address SQL "Update STCTBL set current_state='STOPPING'",         
                  "where jobname=:job and type='CICS'"                
/*-------------------------------------------------------------------*/
/* DFHKE1799 applid TERMINATION OF CICS IS COMPLETE                  */
/*--+----1----+----2----+----3----+----4----+----5----+----6----+----*/
  When msgid == 'DFHKE1799' then
    Address SQL "Update STCTBL set current_state='DOWN'",              
                  "where jobname=:job and type='CICS'",                
                  "and current_state <> 'ERROR'"                       
/*-------------------------------------------------------------------*/
/* Not interested in this message                                    */
/*--+----1----+----2----+----3----+----4----+----5----+----6----+----*/
  Otherwise nop
End
Return