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 {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.
Name of the metric to base the rule on.
Operator for static threshold can be 'Equals', 'NotEquals', 'GreaterThan', 'GreaterThanOrEqual', 'LessThan' or 'LessThanOrEqual'. Operator for dynamic threshold can be 'GreaterThan', 'LessThan', 'GreaterOrLessThan'.
Type of condition threshold.
Optional Parameters
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.
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.
Static threshold value.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
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.