Adding a custom Optimizer rule

Use the Rules page in the Administration tab to create, configure, and manage Optimizer rules to generate alerts and recommendations. For information about Optimizer rules, see Configuring and managing Optimizer rules.

You can create an Optimizer rule based on a predefined template or create a custom rule. This topic explains the procedure to add a custom rule.

Review the existing templates before you create a new custom rule. For details about creating a template-based rule, see Adding a template-based Optimizer rule.

Adding a custom rule 

  1. Click Administration > OPTIMIZER > Rules
  2. In the Optimizer Rules page, click Add new rule.
  3. In the New Optimizer rule page, enter values and make appropriate selections for the following properties:

    Properties marked with (tick) are available only while building a rule in Advanced mode. To switch (toggle) to Advanced mode, click Advanced.

    PropertyDescription
    General
    Name and DescriptionSpecify 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.

    (tick) 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.

    (tick) Data marts (applicable only if Input data is set to based on data marts

    (tick) Data mart Select a data mart from the Data mart list. Only data marts that display systems or business drivers are supported. 
    (tick) 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.

    (tick) 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.

    (tick) 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)
    (tick) Column name Select the data mart column name from the list. The rule will be evaluated based on this column. 
    (tick) 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. 
    • 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. 
    (tick) Comparator The comparative relationship on which to base the condition:
    • greater
    • greater or equal
    • less or equal
    • less
    (tick) 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 descriptionAn 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. 
    (tick) Exclude systems or business driversSelect 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)
    MetricsSelect a performance metric over which you want alerts or recommendations to be generated with the specified severity.
    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 custom statistic (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.

    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.

    ComparatorThe comparative relationship on which to base the condition:
    • greater
    • greater or equal
    • less or equal
    • less
    ThresholdThe threshold value on which to base the condition.
    Condition descriptionAn 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)

        Timestamp2nd May3rd May4th May 
        12:0032.54
        01:00 55.43.7   
        02:003.84.32.9
        03:002.81.72.6
      • Aggregates the values collected for each hour according to the selected statistic (max) to a single value:

        Timestamp2nd May3rd May4th May  Aggregated value of CPU Utilization
        12:0032.544
        01:00 55.43.7   5.4
        02:003.84.32.94.3
        03:002.81.72.62.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
    • Samples at the most granular resolution (detail): None
    ComparatorThe 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.

    Condition descriptionDisplays 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 and Formula

    In the Parameters section, 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 a string.

    You can define multiple parameters by separating them with a newline character (press Enter).

    In the Formula section, enter a formula for the rule by using the Apache Velocity template. For information on the Apache Velocity template,  Apache Velocity template Open link .

    Note: Use only the snake_case naming convention for the values entered in the Parameters and Formula sections. 

    For examples about parameters and formulas, see Examples of formulas and parameters.

    Condition descriptionA 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 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)

        Timestamp2nd May3rd May4th May 
        12:0032.54
        01:00 55.43.7   
        02:003.84.32.9
        03:002.81.72.6
      • Aggregates the values collected for each hour according to the selected statistic (max) to a single value:

        Timestamp2nd May3rd May4th May  Aggregated value of CPU Utilization
        12:0032.544
        01:00 55.43.7   5.4
        02:003.84.32.94.3
        03:002.81.72.62.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
    Comparator

    The comparative relationship on which to base the condition:

    • greater
    • greater or equal
    • less or equal
    • less
    • different more
    Scaling factor 

    Type the number to use for scaling the threshold. The rule calculates the threshold based on the scaling factor.

    For example:

    • If the scaling factor is 1, the threshold will remain the same
    • If the scaling factor is 1.2 and threshold is 50%, then the new threshold will be 120% of 50%, that is, 60%
    • If the scaling factor is 0.5 and threshold is 60%, then the new threshold will be 50% of 60%, that is, 30%

    Tolerance 

    (applicable only if Comparator is set to different more

    Type the number to use for tolerance. 

    [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

    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
    Period type and Condition period

    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.
    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 
    (tick) 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.
    (tick) 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
    (tick) 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.
    • numberFormatter: A utility class to format numbers with measure units.

    For more information, 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:
      • Type the email addresses for recipients of alert notifications, separated by a semicolon (;) in the Send an email to field.
      • To send a copy of the email to the product administrators, in the Admin copy section, select Send to all Continuous Optimization Admins. You can configure the administrator email in Global configuration.
      • To attach a specific report with the email that is sent out, in the Mail attachment section, 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.
    • 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. 
  4. 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 Apache Velocity template. For information on the Apache Velocity template,  Apache Velocity template Open link .

GoalExample 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 availableif (IND_DAYS_TO_SATURATION) { ... }
Get an indicator (IND_DAYS_TO_SATURATION) valueIND_DAYS_TO_SATURATION.value
Get a specific subresource value, for example CPUIND_DAYS_TO_SATURATION.subresource("CPU").value;
Know if data for a certain subresource is available, for example CPUif (IND_DAYS_TO_SATURATION.hasSubresource("CPU")) { ... }
Set a value or threshold in the outputpoint.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 CPUpoint.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;

Screenshot with sample data

Examples of parameters

Define parameters as per the following syntax:

<name of parameter> | <description> | <threshold value> | <type>

Where <type> can be a number or a 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.

GoalParameter 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.

GoalParameter definition

Use the following thresholds in the formula:

  • dts_th_crit|Days to saturation critical threshold|7|number
  • dts_th_warn|Days to saturation warning threshold|30|number

var res = false;
var dts_th = Math.max(dts_th_crit, dts_th_warn);
if (IND_DAYS_TO_SATURATION.value <= dts_th)
{
res = true;
}

Screenshot with sample data

Example of recommendation text or description

The following code block contains an example of a Velocity template description that you can add to the Recommendation text field in the custom Optimizer rule. 

#if ( $point.value0>0)  Forecasted saturation in $numberFormatter.format($point.value0) days. #else Some resources are already saturated. #end 
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


You can use formatting functions that the Velocity template provides in the Recommendation text field. The following table describes some of these formatting functions.

GoalFunctionSuggested for condition type
Get values and thresholds set in the formula$point.value0, $point.threshold0,...
$point.value20, $point.threshold20,...
Formula
Get a list of alerted metrics (resources)$point.alertedResources;Formula
Format a decimal number$numberFormatter.format(numeric_value);Formula
Get the chosen output resolution$alertpoint.getResolution()Data vs. Threshold
Get the statistic used to perform samples aggregation$alertpoint.getStatistic() Data vs. Threshold
Get the threshold value$alertpoint.getThreshold() Data vs. Threshold
Get the value for the specific alert (can be an aggregated value or related to an hour or timestamp, depending on the selected resolution)$alertpoint.getValue() Data vs. Threshold
Get the selected performance metric$alertpoint.getMetric() Data vs. Threshold
Get the selected time period$alertpoint.getTimePeriod() Data vs. Threshold
Get the comparison logic used to compare the value against the threshold

$alertpoint.getComparator() 

Data vs. Threshold

Structure of a recommendation output

A recommendation output is structured as follows:

alert.cond.1.rule.recomm.vtl = 
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:

alert.cond.1.severity = 3

Was this page helpful? Yes No Submitting... Thank you

Comments