在 Azure Monitor 中设定监视解决方案的目标(预览版)Targeting monitoring solutions in Azure Monitor (Preview)

向订阅添加监视解决方案时,默认情况下会自动将它部署到连接到 Log Analytics 工作区的所有 Windows 和 Linux 代理。When you add a monitoring solution to your subscription, it's automatically deployed by default to all Windows and Linux agents connected to your Log Analytics workspace. 你可能希望管理成本,并通过将解决方案的应用范围限制为特定的一组代理来限制为解决方案收集的数据量。You may want to manage your costs and limit the amount of data collected for a solution by limiting it to a particular set of agents. 本文介绍了如何使用“解决方案目标” ,这是一种允许向解决方案界定一个范围的功能。This article describes how to use Solution Targeting which is a feature that allows you to apply a scope to your solutions.

备注

本文最近已更新,从使用术语“Log Analytics”改为使用术语“Azure Monitor 日志”。This article was recently updated to use the term Azure Monitor logs instead of Log Analytics. 日志数据仍然存储在 Log Analytics 工作区中,并仍然由同一 Log Analytics 服务收集并分析。Log data is still stored in a Log Analytics workspace and is still collected and analyzed by the same Log Analytics service. 我们正在更新术语,以便更好地反映 Azure Monitor 中日志的角色。We are updating the terminology to better reflect the role of logs in Azure Monitor. 有关详细信息,请参阅 Azure Monitor 术语更改See Azure Monitor terminology changes for details.

如何为解决方案设定目标How to target a solution

可通过三个步骤为解决方案设定目标,如以下各节中所述。There are three steps to targeting a solution as described in the following sections.

1.创建计算机组1. Create a computer group

通过在 Azure Monitor 中创建计算机组指定要在范围中包括的计算机。You specify the computers that you want to include in a scope by creating a computer group in Azure Monitor. 计算机组可以基于日志查询,也可以从其他来源(例如 Active Directory 或 WSUS 组)导入。The computer group can be based on a log query or imported from other sources such as Active Directory or WSUS groups. 下文所述,只有直接连接到 Azure Monitor 的计算机才会包括在范围中。As described below, only computers that are directly connected to Azure Monitor will be included in the scope.

在工作区中创建计算机组后,将该组包括在范围配置中,然后可以将范围配置应用于一个或多个解决方案。Once you have the computer group created in your workspace, then you'll include it in a scope configuration that can be applied to one or more solutions.

2.创建范围配置2. Create a scope configuration

范围配置包括一个或多个计算机组并且可以应用于一个或多个解决方案。A Scope Configuration includes one or more computer groups and can be applied to one or more solutions.

使用以下过程创建范围配置。Create a scope configuration using the following process.

  1. 在 Azure 门户中,导航到 Log Analytics 工作区并选择你的工作区。In the Azure portal, navigate to Log Analytics workspaces and select your workspace.
  2. 在工作区的属性中,在“工作区数据源”下选择“范围配置”。 In the properties for the workspace under Workspace Data Sources select Scope Configurations.
  3. 单击“添加”以创建新的范围配置。 Click Add to create a new scope configuration.
  4. 为范围配置键入名称Type a Name for the scope configuration.
  5. 单击“选择计算机组”。 Click Select Computer Groups.
  6. 选择创建的计算机组,并视需要选择要添加到配置的其他任何组。Select the computer group that you created and optionally any other groups to add to the configuration. 单击“选择”。 Click Select.
  7. 单击“确定”以创建范围配置。 Click OK to create the scope configuration.

3.将范围配置应用于解决方案。3. Apply the scope configuration to a solution.

创建范围配置后,可以将其应用于一个或多个解决方案。Once you have a scope configuration, then you can apply it to one or more solutions. 请注意,虽然单个范围配置可以用于多个解决方案,但每个解决方案只能使用一个范围配置。Note that while a single scope configuration can be used with multiple solutions, each solution can only use one scope configuration.

使用以下过程应用范围配置。Apply a scope configuration using the following process.

  1. 在 Azure 门户中,导航到 Log Analytics 工作区并选择你的工作区。In the Azure portal, navigate to Log Analytics workspaces and select your workspace.
  2. 在工作区的属性中,选择“解决方案”。 In the properties for the workspace select Solutions.
  3. 单击要为其设置应用范围的解决方案。Click on the solution you want to scope.
  4. 在解决方案的属性中,在“工作区数据源”下选择“解决方案目标”。 In the properties for the solution under Workspace Data Sources select Solution Targeting. 如果此选项不可用,则说明无法为此解决方案设定目标If the option is not available then this solution cannot be targeted.
  5. 单击“添加范围配置”。 Click Add scope configuration. 如果已将某个配置应用于此解决方案,则此选项将不可用。If you already have a configuration applied to this solution then this option will be unavailable. 必须删除现有配置,才能添加另一个配置。You must remove the existing configuration before adding another one.
  6. 单击已创建的范围配置。Click on the scope configuration that you created.
  7. 观察配置的“状态”以确保它显示为“成功”。 Watch the Status of the configuration to ensure that it shows Succeeded. 如果状态指出了错误,请单击配置右侧的省略号并选择“编辑范围配置”来进行更改。 If the status indicates an error, then click the ellipse to the right of the configuration and select Edit scope configuration to make changes.

无法设定目标的解决方案和代理Solutions and agents that can't be targeted

下面是无法用于解决方案目标的代理和解决方案满足的条件。Following are the criteria for agents and solutions that can't be used with solution targeting.

  • 解决方案目标仅适用于部署到代理的解决方案。Solution targeting only applies to solutions that deploy to agents.
  • 解决方案目标仅适用于由 Microsoft 提供的解决方案。Solution targeting only applies to solutions provided by Microsoft. 它不适用于由自己或合作伙伴创建的解决方案。It does not apply to solutions created by yourself or partners.
  • 只能筛选出直接连接到 Azure Monitor 的代理。You can only filter out agents that connect directly to Azure Monitor. 解决方案会自动部署到属于已连接的 Operations Manager 管理组的任何代理,无论它们是否包括在范围配置中。Solutions will automatically deploy to any agents that are part of a connected Operations Manager management group whether or not they're included in a scope configuration.

异常Exceptions

解决方案目标不能用于以下解决方案,尽管它们满足上述条件。Solution targeting cannot be used with the following solutions even though they fit the stated criteria.

  • 代理运行状况评估Agent Health Assessment

后续步骤Next steps