如何在Azure中使用PowerShell或REST API获取已触发的OMS警报的列表 [英] How to get the list of fired OMS alerts using PowerShell or REST API in Azure

查看:56
本文介绍了如何在Azure中使用PowerShell或REST API获取已触发的OMS警报的列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取已触发的警报列表.我已经使用了以下PowerShell cmdlet,但是即使我要传递的ResourceId都有警报,它也不会提供任何输出.

I am trying to get the list of alerts that have been fired. I have used the following PowerShell cmdlet but it does not give any output even though I have alerts for the ResourceId which I am passing.

Get-AzureRmAlertHistory -StartTime 2018-09-01T11:00:00 -EndTime 2018-10-18T12:00:00 -DetailedOutput -ResourceId"/subscriptions/xxxx-xxxx-xxxx-xxxx/resourceGroups/use2-oms -shd-rg001/providers/microsoft.insights/metricAlerts/USE2-RIM-VM-DOWN-ALERT"

Get-AzureRmAlertHistory -StartTime 2018-09-01T11:00:00 -EndTime 2018-10-18T12:00:00 -DetailedOutput -ResourceId "/subscriptions/xxxx-xxxx-xxxx-xxxx/resourceGroups/use2-oms-shd-rg001/providers/microsoft.insights/metricAlerts/USE2-RIM-VM-DOWN-ALERT"

任何人都可以帮助我解决我所缺少的内容吗,或者还有其他方法可以获取列表.

Can anyone help me with what I am missing or is there any other way to get the list.

此致

Ankita

推荐答案

Hello Chaudhari,

Hello Chaudhari,

您确定这是正确的资源URI吗?最近,我们围绕警报的处理方式进行了调整.我不希望再在Resource URI中看到metricAlerts.

Are you sure that is the correct resource URI? We've fairly recently moved around how alerts are handled. I don't expect to see metricAlerts in the Resource URI anymore.

您能否仅尝试一小段时间,就知道没有资源ID发生了警报,并查看那里是否存在输出?

Can you attempt just a small timeframe you know an alert happened without the resource ID, and see if the output is present there?


这篇关于如何在Azure中使用PowerShell或REST API获取已触发的OMS警报的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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