Adding a custom Optimizer rule
To add a custom rule
- Click Administration > OPTIMIZER > Rules.
- In the Optimizer Rules page, click Add new rule.
In the New Optimizer rule page, enter values and make appropriate selections for the following properties:
Properties marked with ✅️ are available only while building a rule in Advanced mode. To switch (toggle) to Advanced mode, click Advanced.
Property
Description
General
Name and Description
Specify a name and optional description for the rule.
Generation schedule
Select an Optimizer task that defines the schedule of the Optimizer rule. All the configured Optimizer rules are available for selection. For example: Optimizer - daily, Optimizer - weekly.
Rule type
Select based on custom conditions.
By default, Condition 1, is displayed in the Conditions section, Also, a new collapsed tab, called Condition 1, is displayed after the Filters tab.
✅️ Input data
Select whether you want the input data to be based on historical data or a specific data mart. By default, historical data is selected.
If you select based on data marts, a new collapsed tab, called Data marts is displayed.
Conditions
Add and apply conditions based on your requirement. A condition, Condition 1, is added by default. You need to configure details of the conditions in their respective collapsed tabs.
For more information, see the Condition n section in this table.
Conditions operator
Select the operator to be used for evaluating the rules with multiple conditions:
- OR: An alert or recommendation is generated when one of the conditions is true.
- AND: An alert or recommendation is generated if all the conditions are true.
By default, OR operator is used for evaluating the rules.
✅️ Data marts (applicable only if Input data is set to based on data marts)
✅️ Data mart
Select a data mart from the Data mart list. Only data marts that display systems or business drivers are supported.
✅️ Entity id column
By default, the system identifier that is used in the data mart is selected.
If the selected data mart does not contain a system identifier, select the metric (column) name from the list.
The metric names listed here are the column names that are displayed in the data mart.
✅️ Subresource name column
Select the column that is identified as the subresource identifier (example: name) column in the data mart. If you do not want the rule to use the subresource columns, select No subresource column.
✅️ Condition n (applicable only if Input data is set to based on data marts)
Severity
Select the level of severity to be associated with the alert and recommendation when the specified condition is met.
- Warning
- Critical
- Efficiency (low)
- Efficiency (medium)
- Efficiency (high)
✅️ Column name
Select the data mart column name from the list. The rule will be evaluated based on this column.
✅️ Value is a metric?
Select the name of the metric to be displayed in the alert logs.
- yes (column name is metric name): The name of the metric is displayed in the alert logs along with it's unit.
For example, if the column name is CPU_UTIL, the name of the metric in the alert logs will be displayed as CPU Utilization %. The unit is displayed in the Value and Threshold columns on the Alert details page. - yes (specified): The name of the metric entered in the Metric field is displayed in the alert logs. If the metric name entered in the Metric field is a metric available in BMC Helix Continuous Optimization,
then the corresponding unit is displayed in the alert logs. If not, only the custom metric name is displayed in the alert logs.
For example:- If the metric name is MEM_FREE, the name of the metric in the alert logs will be displayed as FREE Memory and the corresponding unit (Bytes) will be displayed.
The unit is displayed in the Value and Threshold columns on the Alert details page. - If the metric name is Hello World, the name of the metric in the alert logs will be displayed as Hello World. No unit is displayed in the Value and Threshold columns on the Alert details page.
- If the metric name is MEM_FREE, the name of the metric in the alert logs will be displayed as FREE Memory and the corresponding unit (Bytes) will be displayed.
- no: Only the name of the metric is displayed in the alert logs. No unit is displayed in the Value and Threshold columns on the Alert details page.
✅️ Comparator
The comparative relationship on which to base the condition:
- greater
- greater or equal
- less or equal
- less
✅️ Compare with
Column: Evaluate the rule by comparing the Column name with the column defined in Threshold column.
Threshold: Choose the type of threshold on which to base the condition:
- Optimizer threshold
- custom: In the Threshold field, type a numeric value.
For information about how to define optimizer thresholds, see Configuring-and-managing-thresholds-for-metrics-and-indicators.
Condition description
An auto-generated description briefly describing the current condition.
Filters
Period type and Condition period
Specify the period for which the condition applies. Select one of the following values:
- Use time filter: Select a period from the predefined list.
- Manually specified: If none of the predefined periods meets your requirements, specify the period manually. You can select the resolution (hours, days, weeks, or months) and specify the number. You can also select whether you want to include the current hour/day/week/month in the period based on the resolution. Click Apply after selecting the check box.
Entity selection method
Select the method to choose the entities to which the rule applies. You can select specific entities, those based on a filter, or entities in one or many domains and subdomains.
Select one of the following methods:
- Entity filter: Select a filter from the Select entity filter list as defined in the Workspace. For more information, see Managing-entity-filters.
- All entities
- All entities of a domain: Select one or more domains from the Domain list.
- All entities of a domain and its subdomains: Select a domain or subdomain.
- Specified entities: Select specific systems or business drivers from the Specified systems or business drivers list.
Entity type selection
Select the entity types that you want to include in the rule definition and click Apply.
Select one of the following entity types:
- All entity types
- System types: Select specific system types that you want to include in the rule definition.
- Business driver types: Select specific business drive types that you want to include in the rule definition.
✅️ Exclude systems or business drivers
Select specific systems or business drivers that you want to exclude from the rule evaluation.
Condition n
Severity
Select the level of severity to be associated with the alert and recommendation when the specified condition is met.
- Warning
- Critical
- Efficiency (low)
- Efficiency (medium)
- Efficiency (high)
Condition type
Select the type of condition on which you want the recommendation or alert to be triggered:
- Good/Warn/Poor Samples Count: Enables you to evaluate the percentage of GOOD, WARNING, and POOR samples of a metric (resource) over a specified time range.
You can define the good, warning, and poor thresholds from the Add Thresholds page. For details, see Configuring-and-managing-thresholds-for-metrics-and-indicators.
A sample, for example, CPU_UTIL sample is considered GOOD if it is less than good threshold, WARN if value is between good threshold and warn threshold, and POOR if value is greater than the warn threshold. - Data vs. Threshold: Enables you to set specific thresholds for each metric of your system or business driver and its subobjects, using standard BMC Helix Continuous Optimization
statistics (average, min, max, sum, percentile) and resolutions (summary, hour, and detail).
For example, you can configure a rule that generates an alert if the average value of samples at resolution summary in the period 05-07 2021 [May-July 21] is greater than 70.
- Formula: Enables you to enter a custom formula to generate recommendations.
- Data vs. Baseline: Enables you to compare a metric of your system with a baseline (for example, MONTHLY_BASELINE (ESTIMATED)).
For example, you can configure a rule that generates an alert if the average value of samples at resolution hour in the period Last complete day is less than or equal to 0.1% compared to the MONTHLY_BASELINE.
Metrics
(Not displayed for the Formula Condition type)
Select a performance metric over which you want alerts or recommendations to be generated with the specified severity.
✅️ Namespace
For some of the technologies, metrics from hypervisors and operating systems can be imported into BMC Helix Continuous Optimization and are differentiated by using namespace.
Select one of the following options to obtain values of metrics from.
- Automatic - BMC Helix Continuous Optimization automatically selects an appropriate namespace for each metric. This is the default option.
- opt:meas - Used for the metrics that are collected from the hypervisors. For example, metrics collected by the VMware ETL.
- opt:meas:vn - Used for the metrics that are collected from the operating systems. For example, metrics collected by the Continuous Optimization Agents.
- opt:meas:app - Used for the metrics that are collected from applications.
- opt:der - Used for the derived metrics.
For more details on automatic namespace selection, see Namespaces.
Condition type as Good/Warn/Poor Samples Count
Aggregation function
The type of aggregation to use on the data samples:
- good
- warning
- poor
Define the good, warning, and poor thresholds from the Add Thresholds page. For details, see Configuring-and-managing-thresholds-for-metrics-and-indicators.
A sample, for example, CPU_UTIL sample is considered GOOD if it is less than good threshold, WARN if value is between good threshold and warn threshold, and POOR if value is greater than the warn threshold.For example, if Poor Is selected, the rule will be evaluated if the percentage of poor samples (over the defined time) exceeds the defined threshold.
Comparator
The comparative relationship on which to base the condition:
- greater
- greater or equal
- less or equal
- less
Threshold
The threshold value on which to base the condition.
Condition description
An auto-generated description briefly describing the current condition. For example: Generate alert if the percentage of good samples in the period Last 7 days is greater than 25%
Screenshot when Good/Warn/Poor Samples Count is selected
Condition type as Data vs. Threshold
Resolution
The sample resolution on which to base the condition:
- A single point for the entire period (summary): The sample resolution on which to base the condition. The rule aggregates samples according to the selected statistic
(for example, average, max) of the entire time filter (for example, 5 days) to a single value. This single value is compared (for example, greater, less) to the threshold while evaluating the rule.
For example, if Condition period = 5 days, Aggregation function = average, and Comparator = greater, then:- The rule aggregates all the samples collected over last 5 days
- Calculates the average of all the samples, and
- Compares this single value to the threshold
If the value is greater than the threshold, an alert will be generated.
- A point for each hour of the day (day profile): The sample resolution on which to base the condition. The rule aggregates samples of each hour of the day according to the selected statistic
(for example, average, max) of the entire time filter to a single value. Therefore, there are 24 samples (each for an hour) to be evaluated.
This single value is compared (for example, greater, less) to the threshold while evaluating the rule.
For example: if Condition period = 3 days, Aggregation function = max, and Comparator = less, then:The rule collects the samples reported for each hour of the day (12:00, 1:00, 2:00, and so on)
Timestamp
2nd May
3rd May
4th May
12:00
3
2.5
4
01:00
5
5.4
3.7
02:00
3.8
4.3
2.9
03:00
2.8
1.7
2.6
Aggregates the values collected for each hour according to the selected statistic (max) to a single value:
Timestamp
2nd May
3rd May
4th May
Aggregated value of CPU Utilization
12:00
3
2.5
4
4
01:00
5
5.4
3.7
5.4
02:00
3.8
4.3
2.9
4.3
03:00
2.8
1.7
2.6
2.8
- Compares this single value to the threshold
If the value is less than the threshold, an alert will be generated.
- Samples at the most granular resolution (detail): With the selected resolution, the condition will be evaluated over the samples collected in the last 3 days.
Any period defined in the rule will be ignored. The rule evaluates each sample of the entire time filter and compares (for example, greater, less) the value to the threshold.
The number of samples received may vary according to the granularity defined in the detail resolution (for example, 15 minutes) in the ETL configuration.
Aggregation function
The type of aggregation to use on the data samples.
A single point for the entire period (summary):
- average
- max - Always uses the highest sample over the time filter.
- maximum of daily samples - If more than one sample is received in a day, the rule aggregates the multiple samples based on average statistic.
This single average value is then aggregated based on maximum value of the samples that were collected for each day. - min - Always uses the lowest sample over the time filter.
- minimum of daily samples - If more than one sample is received in a day, the rule aggregates the multiple samples based on average statistic.
This single average value is then aggregated based on minimum value of the samples that were collected for each day. - sum
- 5th percentile
- 10th percentile
- 25th percentile
- 50th percentile
- 75th percentile
- 90th percentile
- 95th percentile
- 99th percentile
- A point for each hour of the day (day profile):
- average
- max - Always uses the highest sample over the time filter.
- maximum of hourly samples - If more than one sample is received in an hour, the rule aggregates the multiple samples based on average statistic.
This single average value is then aggregated based on maximum value of the samples that were collected for each hour. - min - Always uses the lowest sample over the time filter.
- minimum of hourly samples - If more than one sample is received in an hour, the rule aggregates the multiple samples based on average statistic.
This single average value is then aggregated based on minimum value of the samples that were collected for each hour. - sum
- 5th percentile
- 10th percentile
- 25th percentile
- 50th percentile
- 75th percentile
- 90th percentile
- 95th percentile
- 99th percentile
- Samples at the most granular resolution (detail): None
Comparator
The comparative relationship on which to base the condition:
- greater
- greater or equal
- less or equal
- less
- different more
Threshold type
The type of threshold on which to base the condition:
- Optimizer threshold
- custom: In the Threshold field, type a numeric value.
For information about how to define optimizer thresholds, see Configuring-and-managing-thresholds-for-metrics-and-indicators.
Thresholds for subresources
Same threshold for each subresource: Uses the same threshold for each subresource.
Custom threshold for some subresources: Use different thresholds for the subresources that you add in the Subresources pattern field.
- Subresources pattern: Type the name of the subresources. You can also use wildcard character (*) for the subresources that start with, contains or end with the entered keyword.
For example:- sdd*
- /opt/storage/sd*
- Subresources threshold: Type a threshold value for each subresource pattern.
You can add multiple patterns and thresholds using this option.
Note: The alert is generated even if one of the subresources for that entity breaches the threshold.
Condition description
Displays an auto-generated description that describes the current condition.
Screenshot when Data vs. Threshold is selected
Condition type as Formula
Formula options
Select one or more options:
- Based on metrics: In the Metrics section, click Edit and select the metrics. Click Apply to add the metrics to the rule.
- Based on indicators: In the Indicators section, click Edit and select the indicators. Click Apply to add the indicators to the rule.
Parameters
Define parameters to add new thresholds that can be used in the Formula section for the current condition.
Type the parameter as per the following syntax:
<name of parameter> | <description> | <threshold value> | <type>
Where <type> can be a number or string.You can define multiple parameters by separating them with a newline character (press Enter).
Use only the snake_case naming convention for the values entered in the Parameters and Formula sections. In this naming convention, each space between words must be replaced by an underscore (_) character.
For examples of parameters and formulas, see Examples of formulas and parameters.
Formula
Enter a formula for the rule by using the Javascript template.
Use only the snake_case naming convention for the values entered in the Parameters and Formula sections. In this naming convention, each space between words must be replaced by an underscore (_) character.
For examples of parameters and formulas, see Examples of formulas and parameters.
Condition description
A description in the form of a formula for this rule.
Screenshot when Formula is selected
Condition type as Data vs. Baseline
Resolution
The sample resolution on which to base the condition:
- A single point for the entire period (summary): The sample resolution on which to base the condition. The rule aggregates samples according to the selected statistic
(for example, average, max) of the entire time filter (for example, 5 days) to a single value. This single value is compared (for example, greater, less) to the baseline while evaluating the rule.
For example, if Condition period = 5 days, Aggregation function = average, and Comparator = greater, then:- The rule aggregates all the samples collected over last 5 days
- Calculates the average of all the samples, and
- Compares this single value to the baseline
If the value is greater than the baseline, an alert will be generated.
- A point for each hour of the day (day profile): The sample resolution on which to base the condition. The rule aggregates samples of each hour of the day according to the selected statistic
(for example, average, max) of the entire time filter to a single value. Therefore, there are 24 samples (each for an hour) to be evaluated.
This single value is compared (for example, greater, less) to the baseline while evaluating the rule.
For example: if Condition period = 3 days, Aggregation function = max, and Comparator = less, then:The rule collects the samples reported for each hour of the day (12:00, 1:00, 2:00, and so on)
Timestamp
2nd May
3rd May
4th May
12:00
3
2.5
4
01:00
5
5.4
3.7
02:00
3.8
4.3
2.9
03:00
2.8
1.7
2.6
Aggregates the values collected for each hour according to the selected statistic (max) to a single value:
Timestamp
2nd May
3rd May
4th May
Aggregated value of CPU Utilization
12:00
3
2.5
4
4
01:00
5
5.4
3.7
5.4
02:00
3.8
4.3
2.9
4.3
03:00
2.8
1.7
2.6
2.8
- Compares this single value to the threshold
If the value is less than the threshold, an alert will be generated.
Aggregation function
The type of aggregation to use on the data samples.
A single point for the entire period (summary):
- average
- max - Always uses the highest sample over the time filter.
- maximum of daily samples - If more than one sample is received in a day, the rule aggregates the multiple samples based on average statistic.
This single average value is then aggregated based on maximum value of the samples that were collected for each day. - min - Always uses the lowest sample over the time filter.
- minimum of daily samples - If more than one sample is received in a day, the rule aggregates the multiple samples based on average statistic.
This single average value is then aggregated based on minimum value of the samples that were collected for each day. - sum
- 5th percentile
- 10th percentile
- 25th percentile
- 50th percentile
- 75th percentile
- 90th percentile
- 95th percentile
- 99th percentile
- A point for each hour of the day (day profile):
- average
- max - Always uses the highest sample over the time filter.
- maximum of hourly samples - If more than one sample is received in an hour, the rule aggregates the multiple samples based on average statistic.
This single average value is then aggregated based on maximum value of the samples that were collected for each hour. - min - Always uses the lowest sample over the time filter.
- minimum of hourly samples - If more than one sample is received in an hour, the rule aggregates the multiple samples based on average statistic.
This single average value is then aggregated based on minimum value of the samples that were collected for each hour. - sum
- 5th percentile
- 10th percentile
- 25th percentile
- 50th percentile
- 75th percentile
- 90th percentile
- 95th percentile
- 99th percentile
Comparator
The comparative relationship on which to base the condition:
- greater
- greater or equal
- less or equal
- less
- different more
Scaling factor
Enter the number to use for scaling the baseline according to the comparator.
For example, if the comparator = greater:
- If scaling factor = 1, an alert will be generated if the value is greater than the baseline
- If scaling factor = 1.2 and baseline = 50%, then an alert will be generated if the value is greater than 120% of 50%, that is, 60%
- If scaling factor = 0.5 and baseline = 60%, then an alert will be generated if the value is greater than 50% of 60%, that is, 30%
Tolerance
(applicable only if Comparator is set to different more)
Enter the number to use for tolerance of the baseline when the comparator is set to different more.
The formula to calculate the lower and upper limits is: [data point] < [baseline] × (1 - [Tolerance]) OR [data point] > [baseline] × (1 + [Tolerance])
If tolerance = 0.25 and the baseline = 4.5, then according to the formula, lower limit (4.5×(1-0.25)) will be set to 3.375 and upper limit (4.5×(1+0.25)) will be set to 5.625
An alert will be generated if the value is outside the range. For example, an entity with value 6 will be alerted and an entity with value 4 will not be alerted.
Baseline (applicable only if Condition type is set to Data vs. Baseline)
Baseline
Specify a baseline that can be used to compare with historical data. An alert is generated when a metric of the entity has different behavior with respect to the baseline when compared against the historical data.
Select baseline: Select a baseline from the predefined list. For details, Managing-baselines.
You want to be alerted when the memory utilization data of the last complete day is greater when compared against the max of the values in the same day of the week of the last 30 days.
To achieve this, perform the following steps:
- Create a baseline with the following properties:
Name = Max of last 30 days - same weekday, Input time period = 30 days, Aggregation = max, and Consider data for = Same day of the week. For details, Managing-baselines.
- Create a custom optimizer rule based on the Data vs Baseline condition for the Memory Utilization metric with the following properties:
Time filter = Last complete day, Resolution = A single point for the entire period (summary), Aggregation function = average, Comparator = greater, Select baseline = Max of last 30 days - same weekday. - Save the rule. If the current memory utilization value is greater than the baseline data, an alert will be generated.
- Create a baseline with the following properties:
- Manually specified: If none of the predefined baselines meets your requirements, specify the baseline manually.
Aggregation function
(applicable when baseline is set to Manually specified)
The type of aggregation to use on the baselines data.
A single point for the entire period (summary):
- average
- max - Always uses the highest sample over the time filter.
- maximum of daily samples - If more than one sample is received in a day, the rule aggregates the multiple samples based on average statistic.
This single average value is then aggregated based on maximum value of the samples that were collected for each day. - min - Always uses the lowest sample over the time filter.
- minimum of daily samples - If more than one sample is received in a day, the rule aggregates the multiple samples based on average statistic.
This single average value is then aggregated based on minimum value of the samples that were collected for each day. - sum
- 5th percentile
- 10th percentile
- 25th percentile
- 50th percentile
- 75th percentile
- 90th percentile
- 95th percentile
- 99th percentile
- A point for each hour of the day (day profile):
- average
- max - Always uses the highest sample over the time filter.
- maximum of hourly samples - If more than one sample is received in an hour, the rule aggregates the multiple samples based on average statistic.
This single average value is then aggregated based on maximum value of the samples that were collected for each hour. - min - Always uses the lowest sample over the time filter.
- minimum of hourly samples - If more than one sample is received in an hour, the rule aggregates the multiple samples based on average statistic.
This single average value is then aggregated based on minimum value of the samples that were collected for each hour. - sum
- 5th percentile
- 10th percentile
- 25th percentile
- 50th percentile
- 75th percentile
- 90th percentile
- 95th percentile
- 99th percentile
Period type and Condition period
(applicable when baseline is set to Manually specified)
Specify the period for which the condition applies. Select one of the following values:
- Manually specified: If none of the predefined periods meets your requirements, specify the period manually. You can select the resolution (hours, days, weeks, or months) and specify the number.
You can also select whether you want to include the current hour/day/week/month in the period based on the resolution. Click Apply after selecting the check box. - Use time filter: Select a period from the predefined list.
Consider data for
(applicable when baseline is set to Manually specified)
Select the data to be considered to compare a day profile baseline data over the selected condition period.
- Entire period: Entire condition period is considered, hence no baseline data.
- Same day of the week: A data of the previous day of the rule run is considered as a baseline and is compared against the same day of the week over the condition period.
For example, data for all Tuesdays in 60 days of condition period. - Same day of the month: A data of the previous day of the rule run is considered as a baseline and is compared against the same day of the month over the condition period.
For example, data for last Friday in a month in 60 days of condition period.
For example, if the rule is running on 19th Oct (Wednesday) with the following properties: Resolution = A single point for the entire period (summary),
Aggregation function = average, Comparator = greater, Condition period = 60 days, and Consider data for = Same day of the week, then the rule:- Considers the data collected for the previous day (Tuesday) as a baseline data.
- Aggregates the data samples collected for all remaining Tuesdays over last 60 days and calculates the average of all the samples
- Compares this single value to the baseline data
If the value is greater than the baseline data, an alert will be generated.
When a data point is missing
Select the action to be taken when data points are missing.
- Do nothing: Do nothing if the data points are missing.
- Alert: Trigger an alert if the data points are missing.
Screenshot when Data vs. Baseline is selected
Condition type > Common to all condition types
✅️ Condition description message
Select one of the following options:
- Automatic: Use the auto-generated description for the rule.
- Manual: Add velocity template-based custom description messages for alert emails and log tables.
✅️ Custom description for alert email (Velocity)
Available when you select the Manual option for Condition description message. Add a custom description for alert emails and the log table by using the Apache Velocity syntax
to populate the following variables:- point: Data point in which the alert condition is triggered.
- dataFetcher: Extracts a configuration metric, given the key and metric name.
- key: Identifies the system/business driver ID.
- numberFormatter: A utility class to format numbers with measure units. For more information, see
✅️ Custom description for log table (Velocity)
Recommendation type
Select one of the following recommendation types:
- No recommendation: Do not generate any recommendation.
- Cluster over-subscription: Generate recommendations when a cluster is oversubscribed.
- Cluster under-subscription: Generate recommendations when a cluster is under-subscribed.
- Data Ingestion: Generate recommendations when data is ingested.
- Forecasted saturation: Generate recommendations when there are capacity issues related to forecasted saturation.
- Forecasted saturation for Containers: Generate recommendations when there are capacity issues related to forecasted saturation for containers.
- Forecasted saturation for Kubernetes Infrastructures: Generate recommendations when there are capacity issues related to forecasted saturation for Kubernetes infrastructures.
- Generic: Generate a general recommendation.
- Idle Database: Generate recommendations when idle databases are identified.
- Idle VM: Generate recommendations when idle VMs are identified.
- Kubernetes Overallocated Containers: Generate recommendations when overallocated containers are identified.
- Old snapshots: Generate recommendations when old and outdated snapshots are identified.
- Overallocated VM: Generate recommendations when overallocated VMs are identified.
- Power On/Off: Generate recommendations when power on/off VMs are identified.
- Reserved Instances: Generate recommendations about the number of AWS reserved instances to be purchased.
- Unattached Volumes: Generate recommendations when unattached volumes are identified.
The events generated for Forecasted saturation, Forecasted saturation for Containers, and Forecasted saturation for Kubernetes Infrastructures recommendations
can be viewed as events in BMC Helix Operations Management.You can view these events in BMC Helix Operations Management by selecting the Create Events for Future saturation option in the Actions section.
This option is available only for future saturation events.Recommendation text
(Not displayed when Recommendation type is No recommendation)Add recommendation text for each recommendation type by using the Apache Velocity template to populate the following variables:
- point/alertpoint: Data point in which the alert condition is triggered.
- dataFetcher: Extracts a configuration metric, given the key and metric name.
- key: Identifies the system/business driver ID and can be used to provide additional details about the alerted entity.
- numberFormatter: A utility class to format numbers with measure units.
For syntax and examples on using these variables, see Using Velocity Templates in Recommendation rules.
Actions
Actions to perform
Specify the action to be taken when the rule generates an alert or a recommendation. Select one or all of the following actions:
- Send an alert mail: The alert email is sent to the specified recipient.
- Change the status of alerted systems/business drivers and domains based on Risk conditions: The status of the alerted entity changes (colored) based on the rule severity.
If this option is not selected, the rule results are not reported on the Alert log page and the status of the alerted entities is not changed. - Create Events for Future Saturation: This option is available only for Forecasted saturation, Forecasted saturation for Containers, and
Forecasted saturation for Kubernetes Infrastructures recommendations. Events based on the rule definition are triggered and sent to BMC Helix Operations Management.
Mail recipients
(applicable when Send an alert mail is selected)
Select how you want to include the email addresses for recipients of alert notifications, when the Optimizer rule conditions are satisfied. You can enter the email addresses manually or let the rule automatically retrieve the recipient email addresses that are specified for the alerted entities in a data mart column or in a configuration metric.
- Manually specified: Enter the email addresses manually, separated by a semicolon (;) in the Send an email to field.
- Read from metric: To read the email addresses of owners of the alerted entities from a metric, select the required metric from the Mail recipient metric list.
- This list displays string configuration metrics and custom metrics available in your environment. For details on these metrics, see Adding-and-editing-string-configuration-metrics and Viewing-datasets-and-metrics-by-dataset-and-ETL-module.
- Make sure that the selected metric includes owner's email address as value and is associated with the entity being alerted.
- If the selected metric is not associated with that entity, the association with the parent domain is checked and email is sent to the owner of the parent entity.
- In case of multiple entities and ownerships, the rule will split the entities based on the ownership and send alert emails to respective owners with details about their entities.
Consider the example of 10 VMware systems of HR Manager, out of which 5 belong to HR1 and other 5 to HR2. When the specified condition is met, these systems are alerted based on the following criteria:- When you select a metric associated with systems, for example, the OWNER metric, two separate emails are sent to HR1 and HR2 with details of respective alerted systems.
- When you select a metric that is not associated with systems, for example, the APP_OWNER metric, a parent domain is checked and a single email is sent to HR Manager with details of all 10 alerted systems.
- (Displayed when Input data is set to based on data marts) Read from data mart column: To read the email addresses of owners of the alerted entities from a data mart column, select the required column from the Mail recipient data mart column list.
- This list displays the columns of the data mart selected in the Data mart field.
- Make sure that the selected column includes the email address of the owner of the entity being alerted.
Admin copy (applicable when Send an alert mail is selected)
Select Send to all Admins to send a copy of the email to the product administrators. You can configure the administrator email in Configuring-the-global-settings.
Mail attachment (applicable when Send an alert mail is selected)
To attach a specific report with the email that is sent out, select Attach a report and choose a report from the list. By default, Nothing is selected.
You can define a report that can help to determine the cause of the alert or recommendation. This report can be attached to the alert email.- Click Save.
The rule is saved and enabled by default. The rule is listed in the Optimizer rules table. The rule is triggered to run based on the Optimizer task that is associated with the rule.
Examples of formulas
The following table contains some examples of formulas that you can add to the Formula field. You can use the format as the Javascript template.
Goal | Example of formula |
---|---|
Generate an alert on overprovisioned datastores based on metric values (DSTORE_PROVISIONED is greater than DSTORE_SIZE) | alerted = (DSTORE_PROVISIONED.value > DSTORE_SIZE.value); |
Know if data for an indicator/metric (IND_DAYS_TO_SATURATION) is available | if (IND_DAYS_TO_SATURATION) { ... } |
Get an indicator (IND_DAYS_TO_SATURATION) value | IND_DAYS_TO_SATURATION.value |
Get a specific subresource value, for example CPU | IND_DAYS_TO_SATURATION.subresource("CPU").value; |
Know if data for a certain subresource is available, for example CPU | if (IND_DAYS_TO_SATURATION.hasSubresource("CPU")) { ... } |
Set a value or threshold in the output | point.value0 = some_value; point.threshold0 = a_threshold; ...; point.value20 = some_value; point.threshold20 = a_threshold; |
Add a metric (resource) to an alerted subresource, for example CPU | point.addAlertedResource("CPU"); |
Generate an alert when the days to saturation for CPU, memory, or storage is more than the threshold value | var res = false; if(Math.round(IND_DAYS_TO_SATURATION.value)<=30) { if(IND_DAYS_TO_SATURATION.hasSubresource("CPU") && IND_DAYS_TO_SATURATION.subresource("CPU").value<30) { res = true; } if(IND_DAYS_TO_SATURATION.hasSubresource("MEMORY") && IND_DAYS_TO_SATURATION.subresource("MEMORY").value<30) { res = true; } if(IND_DAYS_TO_SATURATION.hasSubresource("STORAGE") && IND_DAYS_TO_SATURATION.subresource("STORAGE").value<30) { res = true; } } alerted = res; |
Generate an alert when all subresources for the entity breach the threshold. | alerted = false; var subs = BYLDISK_SIZE.getSubresources(); if (subs) { alerted = true; for (var i = 0; | <subs.length; i +=1) { var num = subs.get(i).replace(/,/g,"); if (num < th){ alerted = false; point.value0 = num; point.threshold0 = th; point.text0 = "Index: " + i; } } } var num = subs.get(0); point.text0 = num.name; point.text1 = type of num; point.threshold0 = th; point.value0 = num.value; formulaResult = alerted; |
Screenshot with sample data
Examples of parameters
Define parameters as per the following syntax:
Where <type> can be number or string.
Parameters are used to add new thresholds that can be used in formulas. You can define multiple parameters by separating them with a newline character (press Enter).
The following table contains some examples of parameters that you can add to the Parameters field.
Goal | Parameter definition |
---|---|
To create a threshold: Days to saturation – Critical threshold, set to a value of 7 (days) | dts_th_crit|Days to saturation critical threshold|7|number |
To create a threshold: Days to saturation – Warning threshold, set to a value of 30 (days) | dts_th_warn|Days to saturation warning threshold|30|number |
Screenshot with sample data
Example of using parameters in formulas
The following table contains some examples of parameters that are used in a formula in a custom Optimizer rule.
Goal | Parameter definition |
---|---|
Use the following thresholds in the formula:
| var res = false; |
Screenshot with sample data
Using Velocity Templates in Recommendation text
You can use the variables and formatting functions provided by the Velocity template in the Recommendation text field. The following tables and example describe some of these variables and functions.
point/alertpoint
key/dataFetcher
Example of recommendation text or description
The following code block contains an example of a Velocity template description that can be used in the Recommendation text field in the custom Optimizer rule.
Details:
#if ($point.alertedResources.contains('CPU'))
#if ($point.value1>0) CPU will saturate in $numberFormatter.format($point.value1) days.
#else CPU exhausted.
#end
#end
#if ($point.alertedResources.contains('MEMORY'))
#if ($point.value2>0) Memory will saturate in $numberFormatter.format($point.value2) days.
#else Memory exhausted.
#end
#end
#if ($point.alertedResources.contains('STORAGE'))
#if ($point.value3>0) Storage will saturate in $numberFormatter.format($point.value3) days.
#else Storage exhausted.
#end
#end
Structure of a recommendation output
A recommendation output is structured as follows:
Allocate more $stringFormatter.formatList($point.alertedResources)
Setting a status for alerts in the recommendation output
To set a critical status for an alert, you must set the severity as per the ALERT_STATUS table.
For example, to generate a Critical alert whose ID is 3, the structure is as follows: