Azure 网络观察程序中排查连接问题功能的简介Introduction to connection troubleshoot in Azure Network Watcher

网络观察程序的排查连接问题功能可以检查虚拟机 (VM) 之间的直接 TCP 连接、完全限定的域名 (FQDN)、URI 或 IPv4 地址。The connection troubleshoot feature of Network Watcher provides the capability to check a direct TCP connection from a virtual machine to a virtual machine (VM), fully qualified domain name (FQDN), URI, or IPv4 address. 网络方案比较复杂,它们是使用网络安全组、防火墙、用户定义的路由和 Azure 提供的资源实现的。Network scenarios are complex, they are implemented using network security groups, firewalls, user-defined routes, and resources provided by Azure. 复杂的配置给连接问题的排查带来了困难。Complex configurations make troubleshooting connectivity issues challenging. 网络观察程序有助于减少查找和检测连接问题的时间。Network Watcher helps reduce the amount of time to find and detect connectivity issues. 通过返回的结果,可以分析连接问题是平台问题还是用户配置问题造成的。The results returned can provide insights into whether a connectivity issue is due to a platform or a user configuration issue. 可以使用 PowerShellAzure CLIREST API 检查连接。Connectivity can be checked with PowerShell, Azure CLI, and REST API.

重要

连接故障排除需要从中进行故障排除的 VM 安装了 AzureNetworkWatcherExtension VM 扩展。Connection troubleshoot requires that the VM you troubleshoot from has the AzureNetworkWatcherExtension VM extension installed. 有关在 Windows VM 上安装扩展的信息,请访问适用于 Windows 的 Azure 网络观察程序代理虚拟机扩展;有关 Linux VM 的信息,请访问适用于 Linux 的 Azure 网络观察程序代理虚拟机扩展For installing the extension on a Windows VM visit Azure Network Watcher Agent virtual machine extension for Windows and for Linux VM visit Azure Network Watcher Agent virtual machine extension for Linux. 在目标终结点上不需要该扩展。The extension is not required on the destination endpoint.

响应Response

下表显示了运行完连接问题故障排除后返回的属性。The following table shows the properties returned when connection troubleshoot has finished running.

propertiesProperty 说明Description
ConnectionStatusConnectionStatus 连接检查的状态。The status of the connectivity check. 可能的结果为 ReachableUnreachablePossible results are Reachable and Unreachable.
AvgLatencyInMsAvgLatencyInMs 连接检查期间的平均延迟,以毫秒为单位。Average latency during the connectivity check in milliseconds. (仅当检查状态为 reachable 时才显示)(Only shown if check status is reachable)
MinLatencyInMsMinLatencyInMs 连接检查期间的最小延迟,以毫秒为单位。Minimum latency during the connectivity check in milliseconds. (仅当检查状态为 reachable 时才显示)(Only shown if check status is reachable)
MaxLatencyInMsMaxLatencyInMs 连接检查期间的最大延迟,以毫秒为单位。Maximum latency during the connectivity check in milliseconds. (仅当检查状态为 reachable 时才显示)(Only shown if check status is reachable)
ProbesSentProbesSent 检查期间发送的探测数。Number of probes sent during the check. 最大值为 100。Max value is 100.
ProbesFailedProbesFailed 检查期间失败的探测数。Number of probes that failed during the check. 最大值为 100。Max value is 100.
HopsHops 从源到目标的跃点路径。Hop by hop path from source to destination.
Hops[].TypeHops[].Type 资源的类型。Type of resource. 可能的值为 SourceVirtualApplianceVnetLocalInternetPossible values are Source, VirtualAppliance, VnetLocal, and Internet.
Hops[].IdHops[].Id 跃点的唯一标识符。Unique identifier of the hop.
Hops[].AddressHops[].Address 跃点的 IP 地址。IP address of the hop.
Hops[].ResourceIdHops[].ResourceId 如果跃点是 Azure 资源,则表示跃点的 ResourceID。ResourceID of the hop if the hop is an Azure resource. 如果跃点是 Internet 资源,则 ResourceID 为 InternetIf it is an internet resource, ResourceID is Internet.
Hops[].NextHopIdsHops[].NextHopIds 创建的下一跃点的唯一标识符。The unique identifier of the next hop taken.
Hops[].IssuesHops[].Issues 在该跃点上检查期间遇到的问题集合。A collection of issues that were encountered during the check at that hop. 如果未出现任何问题,则该值为空。If there were no issues, the value is blank.
Hops[].Issues[].OriginHops[].Issues[].Origin 当前跃点上出现问题的位置。At the current hop, where issue occurred. 可能的值包括:Possible values are:
Inbound - 问题出现在从前一跃点到当前跃点的链接上Inbound - Issue is on the link from the previous hop to the current hop
Outbound - 问题出现在从当前跃点到下一跃点的链接上Outbound - Issue is on the link from the current hop to the next hop
Local - 问题出现在当前跃点上。Local - Issue is on the current hop.
Hops[].Issues[].SeverityHops[].Issues[].Severity 检测到的问题的严重性。The severity of the issue detected. 可能的值为 ErrorWarningPossible values are Error and Warning.
Hops[].Issues[].TypeHops[].Issues[].Type 所发现问题的类型。The type of issue found. 可能的值包括:Possible values are:
CPU CPU
内存Memory
GuestFirewallGuestFirewall
DnsResolutionDnsResolution
NetworkSecurityRuleNetworkSecurityRule
UserDefinedRouteUserDefinedRoute
Hops[].Issues[].ContextHops[].Issues[].Context 有关发现的问题的详细信息。Details regarding the issue found.
Hops[].Issues[].Context[].keyHops[].Issues[].Context[].key 返回的键值对中的键。Key of the key value pair returned.
Hops[].Issues[].Context[].valueHops[].Issues[].Context[].value 返回的键值对中的值。Value of the key value pair returned.

下面是在跃点上发现的问题示例。The following is an example of an issue found on a hop.

"Issues": [
    {
        "Origin": "Outbound",
        "Severity": "Error",
        "Type": "NetworkSecurityRule",
        "Context": [
            {
                "key": "RuleName",
                "value": "UserRule_Port80"
            }
        ]
    }
]

错误类型Fault types

连接问题故障排除返回有关连接的错误类型。Connection troubleshoot returns fault types about the connection. 下表提供了返回的当前错误类型的列表。The following table provides a list of the current fault types returned.

类型Type 说明Description
CPUCPU CPU 利用率较高。High CPU utilization.
内存Memory 内存利用率较高。High Memory utilization.
GuestFirewallGuestFirewall 虚拟机防火墙配置导致流量被阻止。Traffic is blocked due to a virtual machine firewall configuration.
DNSResolutionDNSResolution 目标地址的 DNS 解析失败。DNS resolution failed for the destination address.
NetworkSecurityRuleNetworkSecurityRule 流量被 NSG 规则阻止(已返回规则)Traffic is blocked by an NSG Rule (Rule is returned)
UserDefinedRouteUserDefinedRoute 用户定义的路由或系统路由导致流量被丢弃。Traffic is dropped due to a user defined or system route.

后续步骤Next steps

了解如何使用 Azure 门户PowerShellAzure CLIREST API 排查连接问题。Learn how to troubleshoot connections using the Azure portal, PowerShell, the Azure CLI, or REST API.