Add-AzMetricAlertRule PowerShell命令

时间:2019-04-18 04:28:10

标签: azure azure-application-insights

我想通过Powershell添加新的度量标准警报规则,但是命令中缺少某些参数。例如,如果要配置信号类型,如何传递参数?

Add-AzMetricAlertRule-名称
                      -位置
                      -ResourceGroup
                      -操作员
                      -TargetResourceId
                      -MetricName                       -TimeAggregationOperator总计                       -WindowSize                       -描述                       -动作

Configure Signal types

1 个答案:

答案 0 :(得分:0)

您可以像这样在参数-MetricName中设置信号类型:

Add-AzMetricAlertRule -Name name -Location yourLocation -ResourceGroupName yourGroup -Operator GreaterThan -MetricName "Percentage CPU" -Threshold 0.1 -WindowSize 00:05:00 -TargetResourceId yourVMResourceId -TimeAggregationOperator Total

但这是经典的警报规则。我找不到用于创建新警报规则的PowerShell命令。但是您可以在门户中或通过Azure CLI command创建新的警报规则。参见difference between Old and New alert