如何创建更新管理警报How to create alerts for Update Management

Azure 中的警报会主动通知你 runbook 作业、服务运行状况问题或与自动化帐户相关的其他情况的结果。Alerts in Azure proactively notify you of results from runbook jobs, service health issues, or other scenarios related to your Automation account. Azure 自动化不包括预配置的警报规则,但你可以基于其生成的数据创建自己的警报规则。Azure Automation does not include pre-configured alert rules, but you can create your own based on data that it generates. 本文介绍如何使用更新管理附带的指标创建警报规则。This article provides guidance on creating alert rules using the metrics included with Update Management.

可用度量值Available metrics

Azure 自动化创建两个不同的平台指标,它们与收集并转发到 Azure Monitor 的更新管理相关。Azure Automation creates two distinct platform metrics related to Update Management that are collected and forwarded to Azure Monitor. 使用指标资源管理器 时,可以使用这些指标进行分析,并使用指标警报规则发出警报。These metric are available for analysis using Metrics Explorer and for alerting using a metrics alert rule.

发出的两个指标为:The two metrics emitted are:

  • 更新部署计算机运行总数Total Update Deployment Machine Runs
  • 更新部署运行总数Total Update Deployment Runs

用于警报时,这两个指标都支持包含附加信息的维度,以帮助将警报的范围限定为特定的更新部署详细信息。When used for alerts, both metrics support dimensions that carry additional information to help scope the alert to a specific update deployment detail. 下表显示了有关配置警报时可用的指标和维度的详细信息。The following table shows the details about the metric and dimensions available when configuring an alert.

信号名称Signal Name 维度Dimensions 说明Description
Total Update Deployment Runs - 更新部署名称- Update Deployment Name
- 状态- Status
针对更新部署的总体状态的警报。Alerts on the overall status of an update deployment.
Total Update Deployment Machine Runs - 更新部署名称- Update Deployment Name
- 状态- Status
- 目标计算机- Target Computer
- 更新部署运行 ID- Update Deployment Run ID
针对特定计算机的更新部署状态的警报。Alerts on the status of an update deployment targeted at specific machines.

创建警报Create alert

按照以下步骤设置警报,以获取更新部署的状态。Follow the steps below to set up alerts to let you know the status of an update deployment. 如果不熟悉 Azure 警报,请参阅 Azure 警报概述If you are new to Azure alerts, see Azure Alerts overview.

  1. 在自动化帐户中,选择“监视”下的“警报”,再选择“新建警报规则” 。In your Automation account, select Alerts under Monitoring, and then select New alert rule.

  2. 在“创建警报规则”页上,系统已选择你的自动化帐户作为资源。On the Create alert rule page, your Automation account is already selected as the resource. 如果要对其进行更改,请选择“编辑资源”。If you want to change it, select Edit resource.

  3. 在“选择资源”页上,从“按资源类型筛选”下拉列表中选择“自动化帐户” 。On the Select a resource page, choose Automation Accounts from the Filter by resource type dropdown list.

  4. 选择要使用的自动化帐户,再选择“完成”。Select the Automation account that you want to use, and then select Done.

  5. 选择“添加条件”以选择适合要求的内容。Select Add condition to chose the signal that's appropriate for your requirement.

  6. 对于维度,请从列表中选择一个有效值。For a dimension, select a valid value from the list. 如果所需的值不在列表中,请选择维度旁边的 +,并键入自定义名称。If the value you want isn't in the list, select + next to the dimension and type in the custom name. 然后选择要查找的值。Then select the value to look for. 若要为某个维度选择所有值,请选择“选择 *”按钮。If you want to select all values for a dimension, select the Select * button. 如果没有为某个维度选择值,更新管理将忽略该维度。If you don't choose a value for a dimension, Update Management ignores that dimension.

    配置信号逻辑

  7. 在“警报逻辑”中的“时间聚合”和“阈值”字段中输入值,然后选择“完成” 。Under Alert logic, enter values in the Time aggregation and Threshold fields, and then select Done.

  8. 在下一页上,输入警报的名称和描述。On the next page, enter a name and a description for the alert.

  9. 对于成功的运行,请将“严重性”字段设置为“信息(严重性 2)”;对于失败的运行,请将其设置为“信息(严重性 1)” 。Set the Severity field to Informational(Sev 2) for a successful run or Informational(Sev 1) for a failed run.

    屏幕截图显示了“定义警报详细信息”部分,其中突出显示了“警报规则名称”、“说明”和“严重性”字段。

  10. 选择“是”以启用预警规则。Select Yes to enable the alert rule.

配置警报对应的操作组Configure action groups for your alerts

配置警报后,可以设置操作组,即用于多个警报的一组操作。Once you have your alerts configured, you can set up an action group, which is a group of actions to use across multiple alerts. 这些操作可能包括电子邮件通知、Runbook、Webhook 等。The actions can include email notifications, runbooks, webhooks, and much more. 若要了解有关操作组的详细信息,请参阅创建和管理操作组To learn more about action groups, see Create and manage action groups.

  1. 选择警报,然后在“操作”下选择“添加操作组”。Select an alert and then select Add action groups under Actions. 此时会显示“选择要附加到此警报规则的操作组”窗格。This will display the Select an action group to attach to this alert rule pane.

    使用情况和预估成本。

  2. 选中要附加的“操作组”的复选框,然后按“选择”。Select the checkbox for the Action group to attach and press Select.

后续步骤Next steps