监视器警报的Arm模板 [英] Arm Templates for Monitor Alerts

查看:128
本文介绍了监视器警报的Arm模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道在尝试通过ARM模板为自动化目的配置Azure监视器警报的问题上是否有任何好的示例或任何帮助。现在,我已经能够通过在所有资源或特定资源
组下找到警报并检查"显示隐藏资源",点击它并转到自动化脚本来获得基础。 

I'm wondering if there is any good examples or any help on my issue trying to configure Azure Monitor Alerts via ARM Templates for Automation Purposes. Now, I've been able to get a base off by finding the Alerts under the All Resources or specific Resource Group and checking 'show hidden resources', clicking on that and going to automation script. 

现在的问题是,在自动化脚本中,它甚至没有在JSON代码中显示所需的标准,比如使用什么度量标准名称,运算符,阈值等。我采取了请查看此链接  https://docs.microsoft.com / en-us / azure / azure-monitor / platform / alerts-metric-create-templates
....但我仍然无法让它们正常工作。

Now the issue is, in the automation script, it does not even show the required criteria in the JSON code for say, what metric name to use, operator, threshold, etc. I've taken a look at this link https://docs.microsoft.com/en-us/azure/azure-monitor/platform/alerts-metric-create-templates .... But I still can't seem to get them to work properly.

我能够通过ARM模板成功创建一个Action Group,但是这些警告会给我提供错误,指出类似于...... "" Message" ;:"指标名称不是发现百分比CPU。"

I am able to create a Action Group successfully via ARM Template, but the alerts give me errors say on the metrics saying something like ... "Message": "The metric names were not found Percentage CPU."

有趣的是,我使用完全相同的度量标准nam在我链接的Microsoft链接中,仍然说它无法找到度量标准名称?是否有源查找ARM模板使用的度量标准名称?也许更好的例子或任何有成功的人?

The funny thing is, I used the exact same Metric name in that Microsoft Link I had linked and still say it can't find the metric name? Is there a source to find Metric Names that ARM Templates use? Maybe better examples or anyone that has had success?

任何帮助总是受到赞赏

干杯

推荐答案

嗨LukeUhren,



您可以参考以下Microsoft文档链接,查看各种方法,以找出所有支持的指标和资源。另请注意,如果Azure的功能发生变化,链接上的信息将会更新。

https://docs.microsoft.com/en-us/azure/azure-监控/平台/警报 - 接近实时的指标

https://docs.microsoft.com/en-us/azure/azure-monitor/platform/metrics-supported

https://docs.microsoft.com/en-us/azure/azure-monitor/platform/metrics-charts

Hi LukeUhren,

You may refer to the below Microsoft documentation links to check various ways to find out all the supported metrics and resources. Also note that, should the features for Azure change, the information on the links would be updated.
https://docs.microsoft.com/en-us/azure/azure-monitor/platform/alerts-metric-near-real-time
https://docs.microsoft.com/en-us/azure/azure-monitor/platform/metrics-supported
https://docs.microsoft.com/en-us/azure/azure-monitor/platform/metrics-charts

我已经提到了您提供的链接,以使用ARM模板创建示例度量标准警报,并且很快就尝试重现该问题,但不会发现任何错误。

I have referred the link that you have provided to create a sample metric alert using an ARM template and quickly tried to reproduce the issue but couldn't come across any errors as such.

关于你得到的错误,即"消息":"未找到指标名称百分比CPU。",AFAIK这种如果度量标准"百分比CPU",则看到错误。您要为其创建警报规则的资源
不支持。目前,度量"百分比CPU"是指"受以下资源类型之一支持。


Microsoft.Compute / virtualMachines

Microsoft.Compute / virtualMachineScaleSets

Microsoft.Compute / virtualMachineScaleSets / virtualMachines

Microsoft.ClassicCompute / virtualMachines

Microsoft.ClassicCompute / domainNames / slots / roles



所以你可以仔细检查资源您通过验证ARM模板中的resourceId参数来使用的类型?

还可以更好地诊断问题提供有关问题的更多背景信息  (例如,使用的警报指标模板是简单的静态/简单动态/高级静态/高级
动态,进程接下来部署ARM模板等)?

And regarding the error you get, i.e., "Message": "The metric names were not found Percentage CPU.", AFAIK this kind of error is seen if the metric "Percentage CPU" is not supported by the resource of type for which you want to create an alert rule. Currently, the metric "Percentage CPU" is supported by one of the below resource types.
Microsoft.Compute/virtualMachines
Microsoft.Compute/virtualMachineScaleSets
Microsoft.Compute/virtualMachineScaleSets/virtualMachines
Microsoft.ClassicCompute/virtualMachines
Microsoft.ClassicCompute/domainNames/slots/roles

So can you double check the resource type that you are using by verifying the resourceId parameter in your ARM template ?
Also to diagnose the issue in a better way can you provide more context around the issue (like, used alert metric template is of simple static / simple dynamic / advanced static / advanced dynamic, process followed to deploy the ARM template, etc.) ?


这篇关于监视器警报的Arm模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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