|
| 1 | +--- |
| 2 | +title: Deploying a CICS policy |
| 3 | +tags: [tutorial] |
| 4 | +keywords: |
| 5 | +summary: "The following steps take you through deploying a sample CICS bundle containing a policy." |
| 6 | +sidebar: cdp_sidebar |
| 7 | +permalink: cdp-Deploying-a-CICS-policy.html |
| 8 | +folder: cdp |
| 9 | +toc: true |
| 10 | +--- |
| 11 | + |
| 12 | +[CICS policies](https://www.ibm.com/support/knowledgecenter/en/SSGMCP_5.5.0/fundamentals/policies/policies.html) are used to monitor the state of the CICS region, and the resources and workload in it. A policy consists of rules that define the conditions that are required to be met for the rule to trigger, and the action to take when the conditions are met. |
| 13 | + |
| 14 | +This tutorial shows how to download a sample CICS policy and deploy it using the CICS deploy plug-in. The policy rule condition is when the number of active tasks in your CICS regions goes above 90% of your MXT value, and action is to issue message DFHMP3009 to the CICS region JES job log. CICS policies and this sample are described in article [Using CICS policy system rules to monitor system health](https://developer.ibm.com/cics/2017/07/04/using-cics-policy-system-rules-monitor-system-health/). |
| 15 | + |
| 16 | +### Procedure |
| 17 | + |
| 18 | +1. Install the Zowe CLI and plug-ins by following the steps in [Installing](cdp-Installing). |
| 19 | + |
| 20 | +2. Create Zowe CLI profiles by following the steps in [Creating Zowe CLI profiles](cdp-Creating-Zowe-CLI-profiles). |
| 21 | + |
| 22 | +3. Clone the [cics-policy-samples](https://github.ibm.com/CICS/cics-policy-samples/tree/master) repository. |
| 23 | + |
| 24 | + ```text |
| 25 | + git clone https://github.ibm.com/CICS/cics-policy-samples.git |
| 26 | +
|
| 27 | + cd cics-policy-samples/bundles/CICSDEV_system_rule |
| 28 | + ``` |
| 29 | + |
| 30 | +4. Deploy the CICS bundle into CICS. |
| 31 | + |
| 32 | + ```text |
| 33 | + zowe cics-deploy push bundle --name Policy --overwrite |
| 34 | + ``` |
| 35 | + |
| 36 | + A progress bar is shown with status messages as the CICS bundle is deployed. This can take a few minutes. The command will summarize the deployment, for example: |
| 37 | + |
| 38 | + <pre class="messageText"> |
| 39 | + WARNING: No .zosAttributes file found in the bundle directory, default values will be applied. |
| 40 | + Regions in scope 'CICPY000' of CICSplex 'ZOSPTINT': |
| 41 | + Applid: CICPY000 jobname: CICPY000 jobid: STC47025 sysname: MV2C |
| 42 | + PUSH operation completed</pre> |
| 43 | + |
| 44 | + The warning can be ignored as the default values result in the files being uploaded in text that is suitable for this bundle. |
| 45 | + |
| 46 | + The CICS BUNDLE resource named `Policy` is defined, installed, and enabled in CICS. If the BUNDLE `Policy` was already defined or installed in CICS, it is undeployed first. As the BUNDLE is enabled, the policy is also enabled. If there are errors, retry with the `--verbose` option for more detailed output, or refer to [Troubleshooting](cdp-Troubleshooting-General). |
| 47 | + |
| 48 | +### Results |
| 49 | + |
| 50 | +The CICS policy is enabled in the CICS region. When the policy rule is triggered, CICS will write message DFHMP3009 to the CICS region JES job log. For details on how to view this log see [Log and trace files](cdp-Troubleshooting-General). |
| 51 | + |
| 52 | +To get started with defining your own CICS policy: |
| 53 | +* [Download and start the CICS Explorer](https://www.ibm.com/support/knowledgecenter/en/SSSQ3W_5.5.0/com.ibm.cics.core.help/topics/concepts/install_planning_client.html). |
| 54 | +* Create a CICS bundle project using the procedure [Creating a CICS bundle project](https://www.ibm.com/support/knowledgecenter/SSSQ3W_5.5.0/com.ibm.cics.core.help/topics/tasks/create_bundle.html). |
| 55 | +* Create a policy using the procedure [To create a policy in a CICS bundle project](https://www.ibm.com/support/knowledgecenter/SSSQ3W_5.5.0/com.ibm.cics.core.help/topics/tasks/task_create_policy.html). |
0 commit comments