az monitor metrics alert condition
Manage near-realtime metric alert rule conditions.
Commands
Name | Description | Type | Status |
---|---|---|---|
az monitor metrics alert condition create |
Build a metric alert rule condition. |
Core | Preview |
az monitor metrics alert condition create
This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Build a metric alert rule condition.
az monitor metrics alert condition create --aggregation {Average, Count, Maximum, Minimum, Total}
--metric
--op --operator {Equals, GreaterOrLessThan, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual, NotEquals}
--type {dynamic, static}
[--dimension]
[--namespace]
[--num-periods]
[--num-violations]
[--sensitivity {High, Low, Medium}]
[--since]
[--skip-metric-validation {false, true}]
[--threshold]
Examples
Build a static condition.
$dim1 = az monitor metrics alert dimension create -n dimName --op Include -v GetBlob PutBlob
$dim2 = az monitor metrics alert dimension create -n Instance --op Exclude -v Get Put
$condition = az monitor metrics alert condition create -t static
--aggregation Count
--metric "CPU Percentage"
--op GreaterThan
--threshold 95
--dimension "$dim1" "$dim2"
Build a dynamic condition.
$condition = az monitor metrics alert condition create -t dynamic
--aggregation Average
--metric "CPU Percentage"
--op GreaterOrLessThan
--num-violations 4
--num-periods 4
--since 2020-11-02T12:11
Required Parameters
Time aggregation.
Property | Value |
---|---|
Accepted values: | Average, Count, Maximum, Minimum, Total |
Name of the metric to base the rule on.
Property | Value |
---|---|
Value from: | az monitor metrics list-definitions |
Operator for static threshold can be 'Equals', 'NotEquals', 'GreaterThan', 'GreaterThanOrEqual', 'LessThan' or 'LessThanOrEqual'. Operator for dynamic threshold can be 'GreaterThan', 'LessThan', 'GreaterOrLessThan'.
Property | Value |
---|---|
Accepted values: | Equals, GreaterOrLessThan, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual, NotEquals |
Type of condition threshold.
Property | Value |
---|---|
Accepted values: | dynamic, static |
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Dimension created by 'az monitor metrics alert dimension create'.
Namespace of metric.
The number of evaluation periods for dynamic threshold. Range: 1-6.
The number of violations to trigger an dynamic alert. Range: 1-6. It should be less than or equal to --num-periods.
Alert sensitivity for dynamic threshold.
Property | Value |
---|---|
Default value: | Medium |
Accepted values: | High, Low, Medium |
The date from which to start learning the metric historical data and calculate the dynamic thresholds. Format: date (yyyy-mm-dd) time (hh:mm:ss.xxxxx) timezone (+/-hh:mm).
Cause the metric validation to be skipped. This allows to use a metric that has not been emitted yet.
Property | Value |
---|---|
Accepted values: | false, true |
Static threshold value.
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |