Azure存储警报 [英] Azure storage alerts

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

问题描述

您好


尝试使用以下脚本在Azure Monitor中创建存储指标警报:

添加-AzureRmMetricAlertRule -Name $ RuleName -Location" East US" -ResourceGroup $ RGName -TargetResourceId $ STOID -MetricName UsedCapacity -Operator GreaterThan -Threshold 4 -WindowSize 00:05:00 -TimeAggregationOperator Average -Description" Storage Acount used capacity exceeded threshold" -Action $ actionEmail 


我收到提醒,


Add-AzureRmMetricAlertRule:异常类型:ErrorResponseException,消息:此资源ID'/ subscriptions / 3d83ea39-不支持具有命名空间''和名称 

'UsedCapacity'的度量​​标准5c9bb7b55af5d316 / resourceGroups / Cus

tomDeployments / providers / Microsoft.Storage / storageAccounts / storageacc'。,代码:UnsupportedMetric,Status 

code:BadRequest,Reason phrase:Bad Request


根据我的研究,当特定Azure区域不支持特定服务时,会抛出类似的错误。我正在选择美国东部地区以保存这些内容,这对我的其他虚拟机相关指标很有用。为什么不存储?
如果没有,那么支持哪些地区?


感谢您的帮助。


干杯


< hr>

Sam(如果适用,请花点时间"投票为有用"和/或"标记为答案"。谢谢!)博客: AnalyticOps Insights Twitter: Sameer
Mhaisekar

解决方案

感谢Sameer提出此问题。 


目前,您只能在Azure门户,
REST API

资源管理器模板
。即将推出使用PowerShell和Azure CLI 2.0及更高版本配置更新警报的支持。


参考文档链接 -  


https://docs.microsoft.com/en-us/azure/azure-monitor/platform/alerts-metric-near-real-time


如果要使用PowerShell,可以使用PowerShell创建经典的存储指标。


以下是TotalRequests的存储Blob指标示例,请注意它是作为经典警报创建的。 


Add-AzureRmMetricAlertRule -Location"west us"-MetricName"TotalRequests"-Name"TotalRequestsRule"-Operator GreaterThan -ResourceGroup"YourRGName"-TargetResourceId"/ subscriptions / xxxxx-xxxx-xxx-xxx-xxxxxxxx / resourceGroups / YourRGName / providers / Microsoft.Storage / storageAccounts / YourStorageAccountName / services / blob"
-Threshold"5"-TimeAggregationOperator Average -WindowSize"02:00:00"-Actions


< blockquote> action -Description"your description"  


希望以上信息有所帮助。 



Hi

Trying to create a storage metric alert in Azure Monitor with the script here:

Add-AzureRmMetricAlertRule -Name $RuleName -Location "East US" -ResourceGroup $RGName -TargetResourceId $STOID -MetricName UsedCapacity -Operator GreaterThan -Threshold 4 -WindowSize 00:05:00 -TimeAggregationOperator Average -Description "Storage Acount used capacity exceeded threshold" -Action $actionEmail

I'm getting an alert,

Add-AzureRmMetricAlertRule : Exception type: ErrorResponseException, Message: The metric with namespace '' and name 
'UsedCapacity' is not supported for this resource id '/subscriptions/3d83ea39-5c9bb7b55af5d316/resourceGroups/Cus
tomDeployments/providers/Microsoft.Storage/storageAccounts/storageacc'., Code: UnsupportedMetric, Status 
code:BadRequest, Reason phrase: Bad Request

From what I researched, similar errors are thrown when the specific service is not supported in that particular Azure region. I am selecting the East US location to save these in and that worked fine for my other VM related metrics. Why not for storage? If not, what regions are supported then?

Thanks for the help.

Cheers


Sam (Please take a moment to "Vote as Helpful" and/or "Mark as Answer" wherever applicable. Thanks!) Blog:AnalyticOps Insights Twitter:Sameer Mhaisekar

解决方案

Thanks Sameer for this question. 

Currently, you can create newer metric alerts only in the Azure portal, REST API, or Resource Manager Templates. Support for configuring newer alerts using PowerShell and Azure CLI versions 2.0 and higher is coming soon.

Documentation link for Reference - 

https://docs.microsoft.com/en-us/azure/azure-monitor/platform/alerts-metric-near-real-time

If you want to use PowerShell , the classic Metrics for storage can be created using PowerShell.

Below is a sample Storage Blob Metric for TotalRequests, please be aware that it gets created as a Classic Alert. 

Add-AzureRmMetricAlertRule -Location "west us" -MetricName "TotalRequests" -Name "TotalRequestsRule" -Operator GreaterThan -ResourceGroup "YourRGName" -TargetResourceId "/subscriptions/xxxxx-xxxx-xxx-xxx-xxxxxxxx/resourceGroups/YourRGName/providers/Microsoft.Storage/storageAccounts/YourStorageAccountName/services/blob" -Threshold "5" -TimeAggregationOperator Average -WindowSize "02:00:00" -Actions


action -Description "your description"  

Hope the above Information helps. 


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

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