Creating automation policies
To create an automation policy
Perform the following steps to create an automation policy.
Step 1: To provide the policy information and specify the execution mode
- In the BMC Helix Intelligent Automation console, go to Policies and click Create Automation Policy.
- In the Policy Information section, enter a unique name and an optional description for the policy.
Select the execution mode as Manual or Automatic depending upon whether you want to execute the policy manually or automatically based on the incoming events.
Step 2: To define the trigger condition to match the incoming event
In the Trigger section, click Browse, and do one of the following:
From the Select Event Type tab, select an existing event type and click Done.
The trigger condition from the event is listed in the following format: <eventCategory>: <eventName>.- On the Paste Event JSON tab, enter the event information in the JSON format, and click Done.
When you select an event, all parameters in the event appear in the right pane.
- Click anywhere in the Trigger Condition box to start building the expression for a trigger condition, and use the suggested parameters, values, and operators to complete the expression.
For sample expressions, see Trigger condition expression.
Step 3: To select actions to be run as part of the policy
- To add action to the policy, click Add Action and perform the following steps using the action wizard:
- From the Pick an automation tool section, click the connector name.
Only configured connectors are displayed here. The wizard takes you to the next step to select an action. - Click Sync Actions.
All actions available in the selected connector appear. - Click Select against the action that you want to add to the policy.
The wizard takes you to the next step to configure an action. Depending on the selected action, provide the information and click Done.
The added action appears in the Action Configuration section. You can add multiple actions in a policy.
- From the Pick an automation tool section, click the connector name.
Step 4: To add tags
- To add system or custom tags to the policy, perform the following steps:
- System tags: Select one or more tags from the list of available system tags.
Based on the event, some system tags are displayed. - Custom tags: In the Tags (Optional) section, enter a key-value pair.
Tag key should start with an alphabet and end with an alphanumeric character. Key supports alphanumeric characters and periods, dashes, and underscores.
- System tags: Select one or more tags from the list of available system tags.
Step 5: To configure change management for creating change requests
To create a change request as part of this policy, perform the following steps:
- If not enabled already, use the Enable change ticket creation toggle button and then click Modify to add change request values.
- Select the appropriate values for the following fields and click Save:
- Impact
- Urgency
- Company
- First Name: By default, first and last name of the logged-in user appears.
When you enter the first name, based on the selected company, the list of user names belonging to that company appear in a list in the <username-firstname-lastname> format. If there are multiple users with the same first name, you can select the correct user from the list. When you select the first name, the last name gets selected. - Last Name
Description: By default, contains the name of the product, BMC Helix Intelligent Automation. The description is updated in the Summary field in the change request in BMC Helix ITSM. Ensure that the description is up to 100 characters only.
The selected values are displayed. When a change is created in BMC Helix ITSM, it will contain the values specified in the policy.
Step 6: To provide estimated savings
- In the Estimated Savings section, enter an approximate time (in minutes) and money (in USD) that you may save by automating the actions.
- Continue to the next step
Step 7: To configure notifications and publish the policy
By default, the Generate Information Event on execution check box is selected. Every time this policy runs, an information event (AUTOMATION_STATUS_EV class) is generated in BMC Helix Operations Management.
Select Publish Policy and click Save.
(Optional step) To test the policy
When creating a policy, you can select an event from the list of events that have occurred in BMC Helix Operations Management. BMC Helix Intelligent Automation listens to BMC Helix Operations Management over a period of time and shows a list of event types to make it easy to build policies. For testing, BMC Helix Intelligent Automation uses the event data selected as part of the policy creation process. It does not create a new event, or wait for a new event coming from BMC Helix Operations Management. You can test a policy with the parameters specified in the policy or update the parameter values to test a policy.
- Click Test Policy.
You are prompted to save the policy. - Click Confirm.
On the Test Inputs tab, a list of event parameters is shown. You can select one or multiple parameters and update the value for the parameters to test the policy.
Click Execute.
The results appear in the Test Results tab. The values updated while testing the policy are not saved as trigger conditions, and the event JSON also does not get updated in the actual policy.
Trigger condition expression
To build a trigger condition expression, you can use the expression builder provided by BMC Helix Intelligent Automation while creating an automation policy. To learn more, see Trigger condition.
The following table lists sample conditions and the events that will match to those conditions:
Scenario | Trigger condition example | Description | Sample event |
---|---|---|---|
Service is down | ( $.event.msg == 'SERVICES_Spooler Service status == 3 0 - Running, 1 - Ok not running, 2 - Warning not running, 3 - Alarm not running for 1 min.' ) && ( $.event.source_hostname == 'vw-host.com' ) && ( $.event.class like_regex '^.*ALARM.*$' ) | Matches any event where msg equals SERVICES_Spooler Service status == 3 0 - Running, 1 - Ok not running, 2 - Warning not running, 3 - Alarm not running for 1 min. and source_hostname equals the hostname specified in the condition, and the class contains ALARM. | |
Overallocated containers | ( $.event.tags.platform like_regex '^.*kubernetes.*$' ) && ( $.event.payload.resources[*].cluster like_regex '^.*vmcluster.*$' ) && ( $.event.payload.resources[*].namespace == 'adeint' ) | Matches any event where the tags.platform contains kubernetes, payload.resources[*].cluster contains the name of the cluster and the payload.resources[*].namespace equals adeint. | |
Stop an Amazon EC2 instance | $.event.event_type like_regex '^.*ec2_stop.*$' && $.event.region_code == 'us-east-1' | Matches any event where the event_type field contains ec2_stop and the region_code is us-east-1. | Sample event for AWS EC2 instance { "event_type": "aws-ec2_stop", "region_code": "us-east-1", "resource_id": "i-07a07b95f94e69673" } |
Where to go from here
After successfully creating policies, you can view the automation policies in the console, see Viewing-editing-and-copying-automation-policies.