Skip to content

【Azure 云服务】Azure Cloud Service 创建 Alert 指南 [基于旧版 Alert(Classic)不可用情况下]

LuBu0505 edited this page May 25, 2021 · 1 revision

问题描述

在Azure云服务(Cloud Service)创建Alert(Classic)时候遇见失败消息:“Failed to update alert testclassicalertrule01. The provided location 'chinanorth2' is not available for resource type 'microsoft.insights/alertrules'. List of available regions for the resource type is 'chinanorth,chinaeast'..

No alt text provided for this image

并提示经典警告将在2024年停用,可以转移到Azure Monitor中创建警告

Classic alerts will be retired on 29 February, 2024. To switch to the new Metric Alerts platform for a faster, more scalable experience, select Migrate to new rules.

**所以: **本文就介绍如何在Azure Monitor 中创建 Alert :

第一步: 从Cloud Service的Metrics中快速进入Azure Monitor的Metrics页面

No alt text provided for this image

当然,也可以从Azure Monitor的页面中点击“Alerts”,选择“Create alert rule”

第二步:进入”Create alert rule” 页面后,第一部分Scope,选择需要监控的资源,默认已经选择好我们当前所使用的Cloud Service中的WebRole

第三步:设置监控条件 “Condition”

  1. 选择Metrics的信号值(Signal),如Percentage CPU
  2. 设置条件阈值(Threshold value)
  3. 调整评估计算的时间段及条件执行的频率,如1分钟的平均值,每1分钟执行一次

No alt text provided for this image

第四步: 设置当Alert被触发后,所执行的动作 “Action”, 如发送邮件

  1. 点击“Add action group”, 选择已有的Action Group name或者是新建。并在其中添加Email Address

No alt text provided for this image

第五步:设置Alert rule的名称及其他内容值

  1. Alert rule name 为必填字段,它会作为所发送警告邮件的主题。

No alt text provided for this image

第六步:在Monitor Alerts页面查看Alert rule的触发记录及邮箱中所收到的邮件

  1. Monitor:https://portal.azure.cn/#blade/Microsoft_Azure_Monitoring/AzureMonitoringBrowseBlade/alertsV2

No alt text provided for this image

参考资料:

Azure 指标资源管理器的高级功能:https://docs.azure.cn/zh-cn/azure-monitor/essentials/metrics-charts#alert-rules

使用 Azure Monitor 创建、查看和管理指标警报:https://docs.azure.cn/zh-cn/azure-monitor/alerts/alerts-metric#view-and-manage-with-azure-portal

在 Azure 门户中创建和管理器操作组:https://docs.azure.cn/zh-cn/azure-monitor/alerts/action-groups

【完】

当在复杂的环境中面临问题,格物之道需:浊而静之徐清,安以动之徐生。 云中,恰是如此!

Clone this wiki locally