使用 Azure 门户在连接监视器中创建监视器Create a monitor in Connection Monitor by using the Azure portal

重要

自 2021 年 7 月 1 日起,你将无法在现有工作区中添加新测试,也无法在网络性能监视器中启用新的工作区。Starting 1 July 2021, you will not be able to add new tests in an existing workspace or enable a new workspace in Network Performance Monitor. 你还将无法在连接监视器(经典版)中添加新的连接监视器。You will also not be able to add new connection monitors in Connection Monitor (classic). 可以继续使用在 2021 年 7 月 1 日之前创建的测试和连接监视器。You can continue to use the tests and connection monitors created prior to 1 July 2021. 为了最大程度地减少当前工作负荷的服务中断,请在 2024 年 2 月 29 日之前,在 Azure 网络观察程序中将测试从网络性能监视器迁移到新连接监视器从连接监视器(经典版)迁移到新连接监视器To minimize service disruption to your current workloads, migrate your tests from Network Performance Monitor or migrate from Connection Monitor (classic) to the new Connection Monitor in Azure Network Watcher before 29 February 2024.

了解如何使用连接监视器监视资源之间的通信。Learn how to use Connection Monitor to monitor communication between your resources. 本文介绍了如何使用 Azure 门户创建监视器。This article describes how to create a monitor by using the Azure portal. 连接监视器支持混合部署和 Azure 云部署。Connection Monitor supports hybrid and Azure cloud deployments.

准备阶段Before you begin

在使用连接监视器创建的连接监视器中,可以将本地计算机和 Azure VM 添加为源。In connection monitors that you create by using Connection Monitor, you can add both on-premises machines and Azure VMs as sources. 这些连接监视器还可以监视与终结点的连接。These connection monitors can also monitor connectivity to endpoints. 终结点可以位于 Azure 上,也可以位于任何其他 URL 或 IP 上。The endpoints can be on Azure or on any other URL or IP.

以下是一些可助你入门的定义:Here are some definitions to get you started:

  • 连接监视器资源Connection monitor resource. 区域特定的 Azure 资源。A region-specific Azure resource. 以下所有实体都是连接监视器资源的属性。All the following entities are properties of a connection monitor resource.
  • EndpointEndpoint. 参与连接性检查的源或目标。A source or destination that participates in connectivity checks. 终结点的示例包括:Examples of endpoints include:
    • Azure VM。Azure VMs.
    • Azure 虚拟网络。Azure virtual networks.
    • Azure 子网。Azure subnets.
    • 本地代理。On-premises agents.
    • 本地子网。On-premises subnets.
    • 包括多个子网的本地自定义网络。On-premises custom networks that include multiple subnets.
    • URL 和 IP。URLs and IPs.
  • 测试配置Test configuration. 针对测试的特定于协议的配置。A protocol-specific configuration for a test. 可以根据所选协议来定义端口、阈值、测试频率和其他参数。Based on the protocol you choose, you can define the port, thresholds, test frequency, and other parameters.
  • 测试组Test group. 包含源终结点、目标终结点和测试配置的组。The group that contains source endpoints, destination endpoints, and test configurations. 连接监视器可包含多个测试组。A connection monitor can contain more than one test group.
  • TestTest. 将源终结点、目标终结点和测试配置组合在一起。The combination of a source endpoint, destination endpoint, and test configuration. 测试是可用于监视数据的最精细级别。A test is the most granular level at which monitoring data is available. 监视数据包括检查失败的百分比和往返时间 (RTT)。The monitoring data includes the percentage of checks that failed and the round-trip time (RTT).

显示了连接监视器的示意图,其中定义了测试组和测试之间的关系。

创建连接监视器Create a connection monitor

若要使用 Azure 门户在连接监视器中创建监视器,请执行以下操作:To create a monitor in Connection Monitor by using the Azure portal:

  1. 在 Azure 门户主页上,转到“网络观察程序”。On the Azure portal home page, go to Network Watcher.

  2. 在左侧窗格的“监视”部分,选择“连接监视器” 。In the left pane, in the Monitoring section, select Connection monitor.

    你会看到在连接监视器中创建的所有连接监视器。You'll see all the connection monitors that were created in Connection Monitor. 若要查看在经典连接监视器中创建的连接监视器,请转到“连接监视器”选项卡。To see the connection monitors that were created in the classic Connection Monitor, go to the Connection monitor tab.

    该屏幕截图显示了在连接监视器中创建的连接监视器。

  3. 在“连接监视器”仪表板的左上角选择“创建” 。In the Connection Monitor dashboard, in the upper-left corner, select Create.

  4. 在“基本信息”选项卡上,为连接监视器输入信息:On the Basics tab, enter information for your connection monitor:

    • 连接监视器名称:输入你的连接监视器的名称。Connection Monitor Name: Enter a name for your connection monitor. 使用针对 Azure 资源的标准命名规则。Use the standard naming rules for Azure resources.

    • 订阅:为连接监视器选择一个订阅。Subscription: Select a subscription for your connection monitor.

    • 区域:为连接监视器选择一个区域。Region: Select a region for your connection monitor. 只能选择在此区域创建的源 VM。You can select only the source VMs that are created in this region.

    • 工作区配置:选择一个自定义工作区或默认工作区。Workspace configuration: Choose a custom workspace or the default workspace. 你的工作区包含监视数据。Your workspace holds your monitoring data.

      • 若要使用默认工作区,请选择此复选框。To use the default workspace, select the check box.
      • 若要选择自定义工作区,请清除此复选框。To choose a custom workspace, clear the check box. 然后为自定义工作区选择订阅和区域。Then select the subscription and region for your custom workspace.

      屏幕截图显示了连接监视器中的“基本信息”选项卡。

  5. 在选项卡底部,选择“下一步:测试组”。At the bottom of the tab, select Next: Test groups.

  6. 在测试组中添加源、目标和测试配置。Add sources, destinations, and test configurations in your test groups. 若要了解如何设置测试组,请参阅在连接监视器中创建测试组To learn about setting up your test groups, see Create test groups in Connection Monitor.

    屏幕截图显示了连接监视器中的“测试组”选项卡。

  7. 在选项卡底部,选择“下一步:创建警报”。At the bottom of the tab, select Next: Create Alerts. 若要了解如何创建警报,请参阅在连接监视器中创建警报To learn about creating alerts, see Create alerts in Connection Monitor.

    屏幕截图显示了“创建警报”选项卡。

  8. 在选项卡底部,选择“下一步:查看 + 创建”。At the bottom of the tab, select Next: Review + create.

  9. 先在“查看 + 创建”选项卡上查看基本信息和测试组,再创建连接监视器。On the Review + create tab, review the basic information and test groups before you create the connection monitor. 如果需要编辑连接监视器,可以返回到相应的选项卡来执行此操作。If you need to edit the connection monitor, you can do so by going back to the respective tabs.

    屏幕截图显示了连接监视器中的“查看 + 创建”选项卡。

    备注

    “查看 + 创建”选项卡显示“连接监视器”阶段每月的成本。The Review + create tab shows the cost per month during the Connection Monitor stage. 目前,“当前成本/月”列未显示任何费用。Currently, the Current Cost/Month column shows no charge. 连接监视器公开上市之后,此列才会显示每月费用。When Connection Monitor becomes generally available, this column will show a monthly charge.

    即使在“连接监视器”阶段,也仍然需要支付 Log Analytics 引入费用。Even during the Connection Monitor stage, Log Analytics ingestion charges apply.

  10. 准备好创建连接监视器后,在“查看 + 创建”选项卡的底部,选择“创建” 。When you're ready to create the connection monitor, at the bottom of the Review + create tab, select Create.

连接监视器在后台创建连接监视器资源。Connection Monitor creates the connection monitor resource in the background.

在连接监视器中创建测试组Create test groups in a connection monitor

每个连接监视器中的测试组都包括按网络参数进行测试的源和目标。Each test group in a connection monitor includes sources and destinations that get tested on network parameters. 它们测试的是失败检查的百分比和基于测试配置的 RTT。They're tested for the percentage of checks that fail and the RTT over test configurations.

在 Azure 门户中,若要在连接监视器中创建测试组,请为以下字段指定值:In the Azure portal, to create a test group in a connection monitor, you specify values for the following fields:

  • 禁用测试组:可以选中此复选框,为测试组指定的所有源和目标禁用监视。Disable test group: You can select this check box to disable monitoring for all sources and destinations that the test group specifies. 默认情况下,此选择处于未选中状态。This selection is cleared by default.

  • 名称:为测试组命名。Name: Name your test group.

  • 来源:如果在 Azure VM 和本地计算机上安装了代理,则可以将前二者均指定为源。Sources: You can specify both Azure VMs and on-premises machines as sources if agents are installed on them. 若要了解如何为源安装代理,请参阅安装监视代理To learn about installing an agent for your source, see Install monitoring agents.

    • 若要选择 Azure 代理,请选择“Azure 终结点”选项卡。此处只能看到绑定到创建连接监视器时指定的区域的 VM。To choose Azure agents, select the Azure endpoints tab. Here you see only VMs that are bound to the region that you specified when you created the connection monitor. 默认情况下,会将 VM 分组到它们所属的订阅中。By default, VMs are grouped into the subscription that they belong to. 已折叠这些组。These groups are collapsed.

      可以从“订阅”级别向下钻取到层次结构中的其他级别:You can drill down from the Subscription level to other levels in the hierarchy:

      订阅 > 资源组 > VNET > 子网 > 具有代理的 VM Subscription > Resource group > VNET > Subnet > VMs with agents

      还可更改“分组依据”选择器,以便从任何其他级别启动树。You can also change the Group by selector to start the tree from any other level. 例如,如果按虚拟网络分组,则会看到层次结构(VNET > 子网 > 具有代理的 VM)中具有代理的 VM 。For example, if you group by virtual network, you see the VMs that have agents in the hierarchy VNET > Subnet > VMs with agents.

      选择 VNET、子网或单个 VM 时,会将相应的资源 ID 设置为终结点。When you select a VNET, subnet, or single VM, the corresponding resource ID is set as the endpoint. 默认情况下,具有 Azure 网络观察程序扩展的选定 VNET 或子网中的所有 VM 都参与监视。By default, all VMs in the selected VNET or subnet that have the Azure Network Watcher extension participate in monitoring. 若要减小范围,请选择特定子网或代理或更改范围属性的值。To reduce the scope, either select specific subnets or agents or change the value of the scope property.

      屏幕截图显示了连接监视器中的“添加源”窗格和“Azure 终结点”选项卡。

    • 若要选择本地代理,请选择“非 Azure 终结点”选项卡。默认情况下,代理按区域分组到工作区中。To choose on-premises agents, select the Non-Azure endpoints tab. By default, agents are grouped into workspaces by region. 所有这些工作区都配置了网络性能监视器。All these workspaces have the Network Performance Monitor configured.

      如果需要将网络性能监视器添加到工作区,请通过 Azure 市场获取。If you need to add Network Performance Monitor to your workspace, get it from Azure Marketplace. 有关如何添加网络性能监视器的信息,请参阅 Azure Monitor 中的监视解决方案For information about how to add Network Performance Monitor, see Monitoring solutions in Azure Monitor.

      在“创建连接监视器”下的“基本信息”选项卡上,已选择默认区域。 Under Create Connection Monitor, on the Basics tab, the default region is selected. 如果更改了区域,则可以在新区域的工作区中选择代理。If you change the region, you can choose agents from workspaces in the new region. 可选择一个或多个代理或子网。You can select one or more agents or subnets. 在“子网”视图中,可以选择要监视的特定 IP。In the Subnet view, you can select specific IPs for monitoring. 如果你添加多个子网,则会创建一个自定义的本地网络“OnPremises_Network_1”。If you add multiple subnets, a custom on-premises network named OnPremises_Network_1 will be created. 还可以通过更改“分组依据”选择器来按代理分组。You can also change the Group by selector to group by agents.

      屏幕截图显示了连接监视器中的“添加源”窗格和“非 Azure 终结点”选项卡。

    • 若要选择最近使用的终结点,可以使用“最近的终结点”选项卡To choose recently used endpoints, you can use the Recent endpoint tab

    • 设置好源之后,在选项卡底部选择“完成”。仍可通过在“创建测试组”视图中选择终结点来编辑基本属性(例如终结点名称)。When you finish setting up sources, select Done at the bottom of the tab. You can still edit basic properties like the endpoint name by selecting the endpoint in the Create Test Group view.

  • 目标:可以通过将 Azure VM、本地计算机或任何终结点(公共 IP、URL 或 FQDN)指定为目标来监视其连接情况。Destinations: You can monitor connectivity to an Azure VM, an on-premises machine, or any endpoint (a public IP, URL, or FQDN) by specifying it as a destination. 在单个测试组中,可添加 Azure VM、本地计算机、Office 365 URL、Dynamics 365 URL 和自定义终结点。In a single test group, you can add Azure VMs, on-premises machines, Office 365 URLs, Dynamics 365 URLs, and custom endpoints.

    • 若要选择 Azure VM 作为目标,请选择“Azure 终结点”选项卡。默认情况下,Azure VM 会分组到某个区域中的订阅层次结构,该区域是在“基本信息”选项卡上的“创建连接监视器”下选择的。 你可以更改区域,并从新区域中选择 Azure VM。To choose Azure VMs as destinations, select the Azure endpoints tab. By default, the Azure VMs are grouped into a subscription hierarchy that's in the region that you selected under Create Connection Monitor on the Basics tab. You can change the region and choose Azure VMs from the new region. 然后,可从订阅级别向下钻取到层次结构中的其他级别,就像设置源 Azure 终结点时可做的操作一样。Then you can drill down from the Subscription level to other levels in the hierarchy, just as you can when you set the source Azure endpoints.

      你可以选择 VNET、子网或单个 VM,就像设置源 Azure 终结点时可做的操作一样。You can select VNETs, subnets, or single VMs, as you can when you set the source Azure endpoints. 选择 VNET、子网或单个 VM 时,会将相应的资源 ID 设置为终结点。When you select a VNET, subnet, or single VM, the corresponding resource ID is set as the endpoint. 默认情况下,具有网络观察程序扩展的选定 VNET 或子网中的所有 VM 都参与监视。By default, all VMs in the selected VNET or subnet that have the Network Watcher extension participate in monitoring. 若要减小范围,请选择特定子网或代理或更改范围属性的值。To reduce the scope, either select specific subnets or agents or change the value of the scope property.

      <屏幕截图显示了“添加目标”窗格和“Azure 终结点”选项卡。>

      <屏幕截图显示了订阅级别的“添加目标”窗格。>

    • 若要选择非 Azure 代理作为目标,请选择“非 Azure 终结点”选项卡。默认情况下,代理按区域分组到工作区中。To choose non-Azure agents as destinations, select the Non-Azure endpoints tab. By default, agents are grouped into workspaces by region. 所有这些工作区都配置了网络性能监视器。All these workspaces have Network Performance Monitor configured.

      如果需要将网络性能监视器添加到工作区,请通过 Azure 市场获取。If you need to add Network Performance Monitor to your workspace, get it from Azure Marketplace. 有关如何添加网络性能监视器的信息,请参阅 Azure Monitor 中的监视解决方案For information about how to add Network Performance Monitor, see Monitoring solutions in Azure Monitor. 有关如何为本地计算机配置代理的信息,请参阅适用于本地计算机的代理For information about how to configure agents for on-premises machines, see Agents for on-premises machines.

      在“创建连接监视器”下的“基本信息”选项卡上,已选择默认区域。 ****  ****  Under Create Connection Monitor, on the Basics tab, the default region is selected. 如果更改了区域,则可以在新区域的工作区中选择代理。If you change the region, you can choose agents from workspaces in the new region. 可选择一个或多个代理或子网。You can select one or more agents or subnets. 在“子网”视图中,可以选择要监视的特定 IP。In the Subnet view, you can select specific IPs for monitoring. 如果你添加多个子网,则会创建一个自定义的本地网络“OnPremises_Network_1”。If you add multiple subnets, a custom on-premises network named OnPremises_Network_1 will be created.

      屏幕截图显示了“添加目标”窗格和“非 Azure 终结点”选项卡。

    • 若要选择公共终结点作为目标,请选择“外部地址”选项卡。终结点列表包含 Office 365 测试 URL 和 Dynamics 365 测试 URL(按名称分组)。To choose public endpoints as destinations, select the External Addresses tab. The list of endpoints includes Office 365 test URLs and Dynamics 365 test URLs, grouped by name. 你还可以选择在同一连接监视器的其他测试组中创建的终结点。You also can choose endpoints that were created in other test groups in the same connection monitor.

      若要添加终结点,请在右上角选择“添加终结点”。To add an endpoint, in the upper-right corner, select Add Endpoint. 然后提供终结点名称和 URL、IP 或 FQDN。Then provide an endpoint name and URL, IP, or FQDN.

      屏幕截图显示了在连接监视器中的何处将公共终结点添加为目标。

    • 若要选择最近使用的终结点,请转至“最近使用的终结点”选项卡 ****  。To choose recently used endpoints, go to the Recent endpoint tab.

    • 选择完目标后,选择“完成”。When you finish choosing destinations, select Done. 仍可通过在“创建测试组”视图中选择终结点来编辑基本属性(例如终结点名称)。You can still edit basic properties like the endpoint name by selecting the endpoint in the Create Test Group view.

  • 测试配置:可以将一个或多个测试配置添加到测试组。Test configurations: You can add one or more test configurations to a test group. 使用“新配置”选项卡创建新的测试配置。或者通过“选择现有项”选项卡添加同一连接监视器的另一测试组中的一个测试配置。Create a new test configuration by using the New configuration tab. Or add a test configuration from another test group in the same Connection Monitor from the Choose existing tab.

    • 测试配置名称:为测试配置命名。Test configuration name: Name the test configuration.

    • 协议:选择“TCP”、“ICMP”或“HTTP”。Protocol: Select TCP, ICMP, or HTTP. 若要将 HTTP 更改为 HTTPS,请选择“HTTP”作为协议,然后选择“443”作为端口 。To change HTTP to HTTPS, select HTTP as the protocol and then select 443 as the port.

      • 创建 TCP 测试配置:只有在“协议”列表中选择“HTTP”时,才会显示此复选框 。Create TCP test configuration: This check box appears only if you select HTTP in the Protocol list. 选择此复选框以创建另一个测试配置,该配置使用你在配置中的其他地方指定的相同源和目标。Select this check box to create another test configuration that uses the same sources and destinations that you specified elsewhere in your configuration. 新的测试配置命名为 <name of test configuration>_networkTestConfigThe new test configuration is named <name of test configuration>_networkTestConfig.
      • 禁用跟踪路由:当协议为 TCP 或 ICMP 时,此复选框适用。Disable traceroute: This check box applies when the protocol is TCP or ICMP. 选择此框以阻止源发现拓扑和逐跳 RTT。Select this box to stop sources from discovering topology and hop-by-hop RTT.
    • 目标端口:你可以提供你选择的目标端口。Destination port: You can provide a destination port of your choice.

      • 侦听端口:当协议为 TCP 时,此复选框适用。Listen on port: This check box applies when the protocol is TCP. 选中此复选框以打开选择的 TCP 端口(如果尚未打开)。Select this check box to open the chosen TCP port if it's not already open.
    • 测试频率:在此列表中,指定源对指定协议和端口上的目标执行 ping 操作的频率。Test Frequency: In this list, specify how frequently sources will ping destinations on the protocol and port that you specified. 可以选择 30 秒、1 分钟、5 分钟、15 分钟或 30 分钟。You can choose 30 seconds, 1 minute, 5 minutes, 15 minutes, or 30 minutes. 选择“自定义”,输入 30 秒到 30 分钟之间的其他频率。Select custom to enter another frequency that's between 30 seconds and 30 minutes. 源将根据所选的值来测试与目标的连接。Sources will test connectivity to destinations based on the value that you choose. 例如,如果选择 30 秒,则源每 30 秒就会至少检查一次与目标的连接情况。For example, if you select 30 seconds, sources will check connectivity to the destination at least once in every 30-second period.

    • 成功阈值:可以在以下网络参数上设置阈值:Success Threshold: You can set thresholds on the following network parameters:

      • 检查失败:设置在源使用指定条件检查到目标的连接情况时可能检查失败的百分比。Checks failed: Set the percentage of checks that can fail when sources check connectivity to destinations by using the criteria that you specified. 对于 TCP 或 ICMP 协议,检查失败的百分比可能会与数据包丢失的百分比相同。For the TCP or ICMP protocol, the percentage of failed checks can be equated to the percentage of packet loss. 对于 HTTP 协议,此值表示未接收到响应的 HTTP 请求的百分比。For HTTP protocol, this value represents the percentage of HTTP requests that received no response.
      • 往返时间:设置 RTT(以毫秒为单位),用于确定源按测试配置连接到目标所需的时间。Round trip time: Set the RTT, in milliseconds, for how long sources can take to connect to the destination over the test configuration.

      屏幕截图显示了在连接监视器中设置测试配置的位置。

在连接监视器中创建警报Create alerts in Connection Monitor

可根据测试配置中设置的阈值为失败的测试设置警报。You can set up alerts on tests that are failing based on the thresholds set in test configurations.

在 Azure 门户中,若要为连接监视器创建警报,请为以下字段指定值:In the Azure portal, to create alerts for a connection monitor, you specify values for these fields:

  • 创建警报:可选中此复选框,在 Azure Monitor 中创建指标警报。Create alert: You can select this check box to create a metric alert in Azure Monitor. 选中此复选框时,其他字段将可供编辑。When you select this check box, the other fields will be enabled for editing. 警报将根据警报定价额外收费。Additional charges for the alert will be applicable, based on the pricing for alerts.

  • “范围” > “资源” > “层次结构”:这些值根据“基本信息”选项卡上指定的值自动填充。Scope > Resource > Hierarchy: These values are automatically filled, based on the values specified on the Basics tab.

  • 条件名称:警报是基于 Test Result(preview) 指标创建的。Condition name: The alert is created on the Test Result(preview) metric. 连接监视器测试结果失败时,警报规则将触发。When the result of the connection monitor test is a failing result, the alert rule will fire.

  • 操作组名称:你可以直接输入电子邮件,也可以通过操作组创建警报。Action group name: You can enter your email directly or you can create alerts via action groups. 如果直接输入电子邮件,则会创建名为“NPM Email ActionGroup”的操作组。If you enter your email directly, an action group with the name NPM Email ActionGroup is created. 电子邮件 ID 将添加到该操作组中。The email ID is added to that action group. 如果选择使用操作组,则需要选择一个以前创建的操作组。If you choose to use action groups, you need to select a previously created action group. 若要了解如何创建操作组,请参阅在 Azure 门户中创建操作组To learn how to create an action group, see Create action groups in the Azure portal. 创建警报后,你可以管理警报After the alert is created, you can manage your alerts.

  • 警报规则名称:连接监视器的名称。Alert rule name: The name of the connection monitor.

  • 创建时启用规则:选中此复选框可以根据条件启用警报规则。Enable rule upon creation: Select this check box to enable the alert rule based on the condition. 如果要创建规则但不启用它,请禁用此复选框。Disable this check box if you want to create the rule without enabling it.

    屏幕截图显示了连接监视器中的“创建警报”选项卡。

规模限制Scale limits

连接监视器具有以下规模限制:Connection monitors have these scale limits:

  • 每个区域每个订阅的最大连接监视器数:100Maximum connection monitors per subscription per region: 100
  • 每个连接监视器的最大测试组:20 个Maximum test groups per connection monitor: 20
  • 每个连接监视器的最大源和目标:100Maximum sources and destinations per connection monitor: 100
  • 每个连接监视器的最大测试组:2 个通过 Azure 门户Maximum test configurations per connection monitor: 2 via the Azure portal

后续步骤Next steps