适用于 Linux 的网络观察程序代理虚拟机扩展Network Watcher Agent virtual machine extension for Linux

概述Overview

Azure 网络观察程序是一项网络性能监视、诊断和分析服务,适用于对 Azure 网络进行监视。Azure Network Watcher is a network performance monitoring, diagnostic, and analytics service that allows monitoring for Azure networks. 网络观察程序代理虚拟机 (VM) 扩展是 Azure VM 上的某些网络观察程序功能(例如按需捕获网络流量)和其他高级功能所必需的。The Network Watcher Agent virtual machine (VM) extension is a requirement for some of the Network Watcher features on Azure VMs, such as capturing network traffic on demand, and other advanced functionality.

本文详细介绍适用于 Linux 的网络观察程序代理 VM 扩展支持的平台和部署选项。This article details the supported platforms and deployment options for the Network Watcher Agent VM extension for Linux. 安装代理时不会中断,也不会需要重新启动 VM。Installation of the agent does not disrupt, or require a reboot, of the VM. 可以将扩展部署到你部署的虚拟机中。You can deploy the extension into virtual machines that you deploy. 如果虚拟机由 Azure 服务部署,请查看该服务的文档以确定它是否允许在虚拟机中安装扩展。If the virtual machine is deployed by an Azure service, check the documentation for the service to determine whether or not it permits installing extensions in the virtual machine.

先决条件Prerequisites

操作系统Operating system

可以针对下列 Linux 分发配置网络观察程序代理扩展:The Network Watcher Agent extension can be configured for the following Linux distributions:

分发Distribution 版本Version
UbuntuUbuntu 12+12+
DebianDebian 7 和 87 and 8
SUSE Linux Enterprise ServerSUSE Linux Enterprise Server 11 和 1211 and 12
OpenSUSE LeapOpenSUSE Leap 42.3+42.3+
CentOSCentOS 6.5+ 和 76.5+ and 7
CoreOSCoreOS 899.17.0+899.17.0+

Internet 连接Internet connectivity

某些网络观察程序代理功能要求将 VM 连接到 Internet。Some of the Network Watcher Agent functionality requires that a VM is connected to the Internet. 如果无法建立传出连接,某些网络观察程序代理功能可能无法正常使用,或者会变得不可使用。Without the ability to establish outgoing connections, some of the Network Watcher Agent features may malfunction, or become unavailable. 有关需要代理的网络观察程序功能的详细信息,请参阅网络观察程序文档For more information about Network Watcher functionality that requires the agent, see theNetwork Watcher documentation.

扩展架构Extension schema

以下 JSON 显示网络观察程序代理扩展的架构。The following JSON shows the schema for the Network Watcher Agent extension. 扩展不需要或不支持用户提供的任何设置。The extension doesn't require, or support, any user-supplied settings. 扩展依赖于其默认配置。The extension relies on its default configuration.

{
    "type": "extensions",
    "name": "Microsoft.Azure.NetworkWatcher",
    "apiVersion": "[variables('apiVersion')]",
    "location": "[resourceGroup().location]",
    "dependsOn": [
        "[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]"
    ],
    "properties": {
        "publisher": "Microsoft.Azure.NetworkWatcher",
        "type": "NetworkWatcherAgentLinux",
        "typeHandlerVersion": "1.4",
        "autoUpgradeMinorVersion": true
    }
}

属性值Property values

名称Name 值/示例Value / Example
apiVersionapiVersion 2015-06-152015-06-15
publisherpublisher Microsoft.Azure.NetworkWatcherMicrosoft.Azure.NetworkWatcher
typetype NetworkWatcherAgentLinuxNetworkWatcherAgentLinux
typeHandlerVersiontypeHandlerVersion 1.41.4

模板部署Template deployment

可使用 Azure 资源管理器模板部署 Azure VM 扩展。You can deploy Azure VM extensions with an Azure Resource Manager template. 若要部署网络观察程序代理扩展,请在模板中使用以前的 json 架构。To deploy the Network Watcher Agent extension, use the previous json schema in your template.

Azure 经典 CLI 部署Azure classic CLI deployment

重要

经典 VM 将于 2023 年 3 月 1 日停用。Classic VMs will be retired on March 1, 2023.

如果从 ASM 使用 IaaS 资源,请在 2023 年 3 月 1 日之前完成迁移。If you use IaaS resources from ASM, please complete your migration by March 1, 2023. 我们建议你尽快进行切换,以利用 Azure 资源管理器中的许多增强功能。We encourage you to make the switch sooner to take advantage of the many feature enhancements in Azure Resource Manager.

有关详细信息,请参阅在 2023 年 3 月 1 日之前将 IaaS 资源迁移到 Azure 资源管理器For more information, see Migrate your IaaS resources to Azure Resource Manager by March 1, 2023.

下面的示例将网络观察程序代理 VM 扩展部署到通过经典部署模型部署的现有 VM:The following example deploys the Network Watcher Agent VM extension to an existing VM deployed through the classic deployment model:

azure config mode asm
azure vm extension set myVM1 NetworkWatcherAgentLinux Microsoft.Azure.NetworkWatcher 1.4

Azure CLI 部署Azure CLI deployment

下面的示例将网络观察程序代理 VM 扩展部署到通过资源管理器部署的现有 VM:The following example deploys the Network Watcher Agent VM extension to an existing VM deployed through Resource Manager:

az vm extension set --resource-group myResourceGroup1 --vm-name myVM1 --name NetworkWatcherAgentLinux --publisher Microsoft.Azure.NetworkWatcher --version 1.4

故障排除和支持Troubleshooting and support

故障排除Troubleshooting

可以从 Azure 门户或 Azure CLI 检索有关扩展部署状态的数据。You can retrieve data about the state of extension deployments using either the Azure portal or Azure CLI.

下面的示例演示使用 Azure CLI 通过资源管理器部署的 VM 的 NetworkWatcherAgentLinux 扩展的部署状态:The following example shows the deployment state of the NetworkWatcherAgentLinux extension for a VM deployed through Resource Manager, using the Azure CLI:

az vm extension show --name NetworkWatcherAgentLinux --resource-group myResourceGroup1 --vm-name myVM1

支持Support

如果对本文中的任何内容不了解,可以参阅网络观察程序文档或联系 Azure 支持上的 Azure 专家。If you need more help at any point in this article, you can refer to the Network Watcher documentation, or contact the Azure experts on the Azure support. 或者,也可以提出 Azure 支持事件。Alternatively, you can file an Azure support incident. 请转到 Azure 支持站点提交请求。Go to the Azure support site and submit your request. 有关使用 Azure 支持的信息,请参阅 Azure 支持常见问题For information about using Azure Support, see the Azure support FAQ.