針對 Azure 監視器中的 Log Analytics VM 延伸模組進行疑難排解

本文可協助您針對在使用執行 Azure 之 Windows 與 Linux 虛擬機器的 Log Analytics VM 擴充功能時可能遇到的錯誤進行疑難排解。 本文會建議解決這些解決項目的可能解決方案。

若要驗證延伸模組的狀態:

  1. 登入 Azure 入口網站

  2. 在入口網站中,選取 [所有服務]。 在資源清單中,鍵入虛擬機器。 當您開始輸入時,清單會根據您的輸入進行篩選。 選取 [虛擬機器]

  3. 在虛擬機器清單中,尋找目標虛擬機器並加以選取。

  4. 在虛擬機器上,選取 [擴充功能]

  5. 檢查清單以查看是否已啟用 Log Analytics 擴充功能。 針對 Linux,代理程式會列為 OMSAgentforLinux。 針對 Windows,代理程式會列為 MicrosoftMonitoringAgent

    Screenshot that shows the VM Extensions view.

  6. 選取該延伸模組以檢視詳細資料。

    Screenshot that shows the VM extension details.

針對 Azure Windows VM 擴充功能進行疑難排解

如果 Microsoft Monitoring Agent VM 擴充功能尚未安裝或沒有回報,請執行下列步驟來針對問題進行疑難排解:

  1. 使用 KB 2965986 中的步驟,檢查 Azure VM 代理程式是否已安裝且正確運作:
    • 您也可以檢閱 VM 代理程式記錄檔 C:\WindowsAzure\logs\WaAppAgent.log
    • 如果記錄不存在,則不會安裝 VM 代理程式。
    • 安裝 Azure VM 代理程式
  2. 檢閱 C:\Packages\Plugins\Microsoft.EnterpriseCloud.Monitoring.MicrosoftMonitoringAgent 中的 Microsoft Monitoring Agent VM 擴充記錄檔。
  3. 確定虛擬機器可以執行 PowerShell 指令碼。
  4. 確定 C:\Windows\temp 的權限未變更。
  5. 在虛擬機器上提高權限的 PowerShell 視窗中輸入 (New-Object -ComObject 'AgentConfigManager.MgmtSvcCfg').GetCloudWorkspaces() | Format-List,以檢視 Microsoft Monitoring Agent 的狀態。
  6. 檢閱 C:\WindowsAzure\Logs\Plugins\Microsoft.EnterpriseCloud.Monitoring.MicrosoftMonitoringAgent\1.0.18053.0\ 中的 Microsoft Monitoring Agent 安裝記錄檔。 此路徑會根據代理程式的版本號碼而變更。

如需詳細資訊,請參閱針對 Windows 擴充功能進行疑難排解

針對 Linux VM 擴充功能執行疑難排解

注意

Microsoft Operations Management Suite 正在轉換為 Azure 監視器,而適用於 Windows 或 Linux 的 Operations Management Suite 代理程式屬於此轉換的一部份,之後會將其稱為適用於 Windows 的 Log Analytics 代理程式和適用於 Linux 的 Log Analytics 代理程式。

如果 Log Analytics Linux 代理程式 VM 擴充功能尚未安裝或沒有回報,可以執行下列步驟來針對問題進行疑難排解:

  1. 如果擴充狀態是「未知」,請檢閱 VM 代理程式記錄檔 /var/log/waagent.log,以檢查 Azure VM 代理程式是否已安裝且正常運作。
  2. 若是其他不良狀態,請檢閱 /var/log/azure/Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux/*/extension.log/var/log/azure/Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux/*/CommandExecution.log 中的 Log Analytics Linux 代理程式 VM 擴充功能記錄。
  3. 如果擴充狀態良好,但資料未上傳,請檢閱 /var/opt/microsoft/omsagent/log/omsagent.log 中的 Log Analytics Linux 代理程式記錄檔。

下一步

如需 Log Analytics Linux 代理程式相關的更多疑難排解指引,請參閱針對 Linux 的 Log Analytics 代理程式問題進行疑難排解