如何通过Add-AzMetricAlertRule设置信号类型? [英] How to set signal types through Add-AzMetricAlertRule ?

查看:65
本文介绍了如何通过Add-AzMetricAlertRule设置信号类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



Add-AzMetricAlertRule -Name

-Location

-ResourceGroup

-Operator

-TargetResourceId

-MetricName 

-TimeAggregationOperator 

-WindowSize 

-Description 

-Action



Sourav Karmakar

I want to add a new metric alert rule through powershell, but some parameters in the command are missing. For example, How to pass the parameters if I want to configure the signal types ?

Add-AzMetricAlertRule -Name
-Location
-ResourceGroup
-Operator
-TargetResourceId
-MetricName 
-TimeAggregationOperator 
-WindowSize 
-Description 
-Action


Sourav Karmakar

推荐答案

嗨Sourav,

Hi Sourav,

根据您的问题,您似乎正在尝试创建信号类型"指标"的警报。

According to your question, it seems that you are trying to create an alert of signal type 'Metrics'.

正如您正确提到的,您必须使用'Add-Az 指标 AlertRule'来创建信号类型'指标'的警报

As you have correctly mentioned, you will have to use 'Add-AzMetricAlertRule' to create an alert of signal type 'Metrics'

由于上述命令行开关特定于一种信号类型,因此您无法将其作为参数传递给命令行开关。 

Since the above commandlet is specific to one signal type, you cannot pass it as a parameter to the commandlet. 

如果您想使用dif例如'活动日志',您可以使用'Set-Az 活动日志警报'

If you want to use a different signal type for example 'Activity Log', you can use 'Set-AzActivityLogAlert'

https://docs.microsoft.com/en-us/powershell/module/az.monitor/ set-azactivitylogalert?view = azps-1.7.0

但是,如果您要在参数中设置信号名称,请按照以下主题进行操作:

However, if you are looking to set signal names in the parameter please follow the below thread:

https://stackoverflow.com/ questions / 55739154 / missing-signal-type-parameter-in-add-azmetricalertrule-powershell-command

希望这会有所帮助!


这篇关于如何通过Add-AzMetricAlertRule设置信号类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆