使用 Azure 门户设置针对 Azure Database for MariaDB 指标的警报Use the Azure portal to set up alerts on metrics for Azure Database for MariaDB

本文介绍了如何使用 Azure 门户设置 Azure Database for MariaDB 警报。This article shows you how to set up Azure Database for MariaDB alerts using the Azure portal. 可根据监视指标接收 Azure 服务的警报。You can receive an alert based on monitoring metrics for your Azure services.

当指定的指标值越过了分配的阈值时,就会触发此警报。The alert triggers when the value of a specified metric crosses a threshold you assign. 首次满足条件时,以及之后不再满足条件时,都会触发此警报。The alert triggers both when the condition is first met, and then afterwards when that condition is no longer being met.

可配置警报,使警报触发时执行以下操作:You can configure an alert to do the following actions when it triggers:

  • 向服务管理员和共同管理员发送电子邮件通知Send email notifications to the service administrator and co-administrators
  • 将电子邮件发送到指定的其他电子邮件地址。Send email to additional emails that you specify.
  • 调用 WebhookCall a webhook

可使用以下项配置并获取预警规则相关信息:You can configure and get information about alert rules using:

在指标上创建警报规则Create an alert rule on a metric

  1. Azure 门户中,选择要监视的 Azure Database for MariaDB 服务器。In the Azure portal, select the Azure Database for MariaDB server you want to monitor.

  2. 在边栏的“监视”部分,选择“警报”,如下所示 :Under the Monitoring section of the sidebar, select Alerts as shown:

    选择“警报规则”

  3. 选择“添加指标警报”(+ 图标) 。Select Add metric alert (+ icon).

  4. 随即打开“创建规则”页面,如下所示 。The Create rule page opens as shown below. 填写所需信息:Fill in the required information:

    添加指标警报窗体

  5. 在“条件”部分中,选择“添加条件” 。Within the Condition section, select Add condition.

  6. 从要发出警报的信号列表中选择一个指标。Select a metric from the list of signals to be alerted on. 在此示例中,选择“存储百分比”。In this example, select "Storage percent".

    选择指标

  7. 配置警报逻辑,包括“条件”(例如, Configure the alert logic including the Condition (ex. “大于”)、“阈值”(例如, "Greater than"), Threshold (ex. 85%)、“时间聚合”、触发警报前必须满足指标规则的“时间段”。(例如, 85 percent), Time Aggregation, Period of time the metric rule must be satisfied before the alert triggers (ex. “30 分钟”)、以及“频率” 。"30 minutes"), and Frequency.

    完成后选择“完成” 。Select Done when complete.

    选择指标

  8. 在“操作组”部分中,选择“新建”创建新组以接收有关警报的通知 。Within the Action Groups section, select Create New to create a new group to receive notifications on the alert.

  9. 使用名称、短名称、订阅和资源组填写“添加操作组”表单。Fill out the "Add action group" form with a name, short name, subscription, and resource group.

  10. 配置“电子邮件/短信”操作类型 。Configure an Email/SMS action type.

    选择“电子邮件 Azure 资源管理器角色”以选择订阅所有者、参与者和读取器来接收通知。Choose "Email Azure Resource Manager Role" to select subscription Owners, Contributors, and Readers to receive notifications.

    (可选)如果希望在警报触发时调用有效的 URI,请将其放入“Webhook”字段 。Optionally, provide a valid URI in the Webhook field if you want it called when the alert fires.

    完成后选择“确定” 。Select OK when completed.

    操作组

  11. 指定预警规则名称、说明和严重性。Specify an Alert rule name, Description, and Severity.

    操作组

  12. 选择“创建警报规则”可以创建警报 。Select Create alert rule to create the alert.

    几分钟后,警报将处于活动状态,并按前面所述进行触发。Within a few minutes, the alert is active and triggers as previously described.

管理警报Manage your alerts

创建警报后,可选择它并执行以下操作:Once you have created an alert, you can select it and do the following actions:

  • 查看图,了解与此警报相关的指标阈值和前一天实际值。View a graph showing the metric threshold and the actual values from the previous day relevant to this alert.
  • 编辑或删除预警规则 。Edit or Delete the alert rule.
  • 如果要暂时停止或恢复接收通知,可禁用或启用警报 。Disable or Enable the alert, if you want to temporarily stop or resume receiving notifications.

后续步骤Next steps