相依性代理程式會收集虛擬機上執行的進程及其外部進程相依性的相關數據。 更新包括 Bug 修正或新功能的支援。 本文描述 Dependency Agent 的需求,以及如何手動或透過自動化方式升級該代理程式。
這很重要
VM Insights 中的相依性代理程式和地圖功能將於2028年6月30日淘汰。 如需詳細資訊,請參閱 我們的淘汰指引 。
附註
Dependency Agent 會將活動訊號資料傳送至 InsightsMetrics 資料表,此操作會產生資料擷取費用。 此行為與 Azure 監視器代理程式不同,其會將代理程式健康情況數據傳送至 活動訊號 數據表,而該數據表不受數據收集費用所收取。
Dependency Agent 需求
- Azure 監視器代理程式必須安裝在相同的電腦上。
- 需要從虛擬機器連線至位址 169.254.169.254。 此位址會識別 Azure 中繼資料的服務端點。
VM Insights 支援的作業系統
下列作業系統:
- Azure 監視器代理程序支援的所有作業系統。 請參閱 Azure 監視器代理程式支援的作業系統和環境。
- Dependency Agent 目前支援與 Azure 監視器代理程式所支援的 Windows 版本相同,最高支援到 Windows Server 2022,但 Azure Stack HCI 和 Windows IoT 企業版除外。 不支援 Windows Server Core。
- 如需相依性代理程式的Linux支援,請參閱 相依性代理程式Linux支援 和 Linux考慮。
- 相依性代理程式僅支援 x64 架構。
Linux 考量因素
在 Linux 電腦上安裝 VM Insights 的相依性代理程式之前,請考慮下列事項:
- 只支援預設版本和 SMP Linux 核心版本。
- 所有 Linux 散發套件皆不支援非標準的核心版本,例如實體位址擴充 (PAE) 和 Xen。 例如,不支援版本字串為 2.6.16.21-0.8-xen 的系統。
- 不支援自訂核心,包括重新編譯的標準核心。
- 對於 9.4 版以外的 Debian 散發版本,不支援對應功能。 [效能] 功能只能從 [Azure 監視器] 功能表取得。 您無法直接透過 Azure VM 的左側窗格存取。
- 支援 CentOSPlus 核心。
- 安裝相依性代理程式會損及 Linux 核心,而且您可能會失去 Linux 發行版的支援,直到機器重設為止。
必須針對 Spectre 和 Meldown 弱點修補 Linux 核心。 如需更多資訊,請洽詢 Linux 發行版供應商。 執行下列命令,即可檢查是否已緩解 Spectre/Meldown 相關問題:
$ grep . /sys/devices/system/cpu/vulnerabilities/*
此命令的輸出看起來與下列內容相似,且說明機器是否易受任一問題的影響。 如果遺失這些檔案,機器就無法修補。
/sys/devices/system/cpu/vulnerabilities/meltdown:Mitigation: PTI
/sys/devices/system/cpu/vulnerabilities/spectre_v1:Vulnerable
/sys/devices/system/cpu/vulnerabilities/spectre_v2:Vulnerable: Minimal generic ASM retpoline
安裝或升級 Dependency Agent
附註
在機器上啟用 VM Insights 以進行進程和連線數據時,會自動安裝相依性代理程式。 如果僅針對效能資料啟用 VM Insights,則不會安裝 Dependency Agent。
您可以使用下列方法,根據執行機器的部署案例和環境,手動或自動升級適用於 Windows 和 Linux 的 Dependency Agent:
| 環境 | 安裝方法 | 升級方法 |
|---|---|---|
| Azure VM | 適用於 Windows 和 Linux 的 Dependency Agent VM 延伸模組 | 代理程式會預設自動升級,除非您在 Azure Resource Manager 範本中設定屬性為 autoUpgradeMinorVersion,以選擇不升級。 次要版本 (停用自動升級) 及主要版本的升級依循相同方法:解除安裝並重新安裝延伸模組。 |
| 自訂 Azure VM 映像 | 手動安裝適用於 Windows/Linux 的 Dependency Agent | 要將虛擬機器 (VMs) 更新為最新版本的代理程式,需透過命令列執行 Windows 安裝套件或 Linux 自解壓縮且可安裝的殼層指令碼包進行操作。 |
| 非 Azure 虛擬機 | 手動安裝適用於 Windows/Linux 的 Dependency Agent | 要將虛擬機器 (VMs) 更新為最新版本的代理程式,需透過命令列執行 Windows 安裝套件或 Linux 自解壓縮且可安裝的殼層指令碼包進行操作。 |
在 Windows 上手動安裝或升級 Dependency Agent
使用指令碼或其他自動化解決方案,或使用InstallDependencyAgent-Windows.exe 安裝精靈,從命令提示字元更新 Windows VM 上的代理程式。
必要條件
- 從 aka.ms/dependencyagentwindows 下載最新版本的 Windows 代理程式。
使用安裝精靈
以具有系統管理權限的帳戶登入電腦。
執行 InstallDependencyAgent-Windows.exe 啟動安裝精靈。
依循 [Dependency Agent 安裝] 精靈解除安裝舊版的 Dependency Agent,並安裝最新版本。
從命令列
使用具有系統管理權限的帳戶登入電腦。
執行以下命令:
InstallDependencyAgent-Windows.exe /S /RebootMode=manual若某些流程使用並鎖定舊版的檔案,
/RebootMode=manual參數會讓升級時無法自動重新開機。若要確認升級成功,請查看
install.log以取得詳細的安裝資訊。 記錄目錄是 %Programfiles%\Microsoft Dependency Agent\logs。
在 Linux 上手動安裝或升級 Dependency Agent
Linux Dependency Agent 舊版本的升級是被支援的,且使用與全新安裝相同的命令來執行。
必要條件
- 從 aka.ms/dependencyagentlinux 或透過 curl 下載最新版的 Linux 代理程式:
curl -L -o DependencyAgent-Linux64.bin https://aka.ms/dependencyagentlinux
附註
Curl 不會自動設定執行權限。 您必須使用 chmod 進行手動設定:
chmod +x DependencyAgent-Linux64.bin
從命令列
使用具有 sudo 權限,能夠以 root 身分執行命令的使用者帳戶登入電腦。
執行以下命令:
sudo <path>/InstallDependencyAgent-Linux64.bin
如果 Dependency Agent 無法啟動,請檢查記錄以取得詳細的錯誤資訊。 在 Linux 代理程式上,記錄檔的目錄是 /var/opt/microsoft/dependency-agent/log。
解除安裝 Dependency Agent
附註
如果已手動安裝相依性代理程式,它將不會顯示在 Azure 入口網站中,而且必須手動卸載。 其只有在透過 Azure 入口網站、PowerShell、ARM 範本部署,或 Azure 原則安裝時才會顯示。
從 Azure 入口網站的 [虛擬機器] 功能表中,選取虛擬機器。
選取 [擴充功能 + 應用程式]> [DependencyAgentWindows] 或 [DependencyAgentLinux]> [解除安裝]。
在 Windows 上手動解除安裝 Dependency Agent
方法 1:在 Windows 中,移至 [新增和移除程式]、尋找Microsoft Dependency Agent,按一下省略號以開啟捷徑功能表,然後選取 [解除安裝]。
方法 2:使用位於 Microsoft Dependency Agent 資料夾中的解除安裝程式,例如 C:\Program Files\Microsoft Dependency Agent"\Uninstall_v.w.x.y.exe (其中 v.w.x.y 是版本號碼)。
在 Linux 上手動解除安裝 Dependency Agent
使用具有 sudo 權限,能夠以 root 身分執行命令的使用者帳戶登入電腦。
執行以下命令:
sudo /opt/microsoft/dependency-agent/uninstall -s
Dependency Agent Linux 支援
由於 Dependency Agent 可在核心層級運作,因此支援也會相依於核心版本。 從 Dependency Agent 9.10.* 版起,代理程式支援 * 個核心。 下表列出 Dependency Agent 的主要和次要 Linux OS 版本和支援的核心版本。
附註
使用 Dependency Agent 9.10.15 和更新版本時,不會針對不支援的核心版本封鎖安裝,但代理程式會以降級模式執行。 在此模式中,不會收集儲存在 VMConnection 和 VMBoundport 資料表中的連線和連接埠資料。 VMProcess 資料表可能會有一些資料,但會是最少量的資料。
| 散發 | 作業系統版本 | 核心版本 |
|---|---|---|
| Red Hat Linux 8 | 8.6 | 4.18.0-372.*el8.x86_64, 4.18.0-372.*el8_6.x86_64 |
| 8.5 | 4.18.0-348.*el8_5.x86_644.18.0-348.*el8.x86_64 | |
| 8.4 | 4.18.0-305.*el8.x86_64, 4.18.0-305.*el8_4.x86_64 | |
| 8.3 | 4.18.0-240.*el8_3.x86_64 | |
| 8.2 | 4.18.0-193.*el8_2.x86_64 | |
| 8.1 | 4.18.0-147.*el8_1.x86_64 | |
| 8.0 | 4.18.0-80.*el8.x86_64 4.18.0-80.*el8_0.x86_64 |
|
| Red Hat Linux 7 | 7.9 | 3.10.0-1160 |
| 7.8 | 3.10.0-1136 | |
| 7.7 | 3.10.0-1062 | |
| 7.6 | 3.10.0-957 | |
| 7.5 | 3.10.0-862 | |
| 7.4 | 3.10.0-693 | |
| Red Hat Linux 6 | 6.10 | 2.6.32-754 |
| 6.9 | 2.6.32-696 | |
| CentOS Linux 8 | 8.6 | 4.18.0-372.*el8.x86_64, 4.18.0-372.*el8_6.x86_64 |
| 8.5 | 4.18.0-348.*el8_5.x86_644.18.0-348.*el8.x86_64 | |
| 8.4 | 4.18.0-305.*el8.x86_64, 4.18.0-305.*el8_4.x86_64 | |
| 8.3 | 4.18.0-240.*el8_3.x86_64 | |
| 8.2 | 4.18.0-193.*el8_2.x86_64 | |
| 8.1 | 4.18.0-147.*el8_1.x86_64 | |
| 8.0 | 4.18.0-80.*el8.x86_64 4.18.0-80.*el8_0.x86_64 |
|
| CentOS Linux 7 | 7.9 | 3.10.0-1160 |
| 7.8 | 3.10.0-1136 | |
| 7.7 | 3.10.0-1062 | |
| CentOS Linux 6 | 6.10 | 2.6.32-754.3.5 2.6.32-696.30.1 |
| 6.9 | 2.6.32-696.30.1 2.6.32-696.18.7 |
|
| Ubuntu Server | 20.04 | 5.8 5.4* |
| 18.04 | 5.3.0-1020 5.0 (包括Azure 微調的核心) 4.18* 4.15* |
|
| 16.04.3 | 4.15.* | |
| 16.04 | 4.13.* 4.11.* 4.10.* 4.8.* 4.4.* |
|
| 14.04 | 3.13.*-通用 4.4.*-通用 |
|
| SUSE Linux 12 Enterprise Server | 12 SP5 | 4.12.14-122.*-預設,4.12.14-16.*-Azure |
| 12 SP4 | 4.12.* (包括Azure 微調的核心) | |
| 12 SP3 | 4.4.* | |
| 12 SP2 | 4.4.* | |
| SUSE Linux 15 Enterprise Server | 15 SP1 | 4.12.14-197.*-default, 4.12.14-8.*-azure |
| 15 | 4.12.14-150.*-default | |
| Debian | 9 | 4.9 |
附註
使用 Ampere Altra ARM 型處理器的 Azure 虛擬機器不支援相依性代理程式。
下一步
若要停止監視 VM 一段時間或完全移除 VM 深入解析,請參閱在 VM 深入解析中停用 VM 的監視。
![顯示虛擬機器的 [延伸模組和應用程式] 畫面的螢幕擷取畫面。](media/vminsights-dependency-agent/azure-monitor-uninstall-dependency-agent.png)