您可以使用範例指令碼監控實體伺服器中的作業系統。

範例指令碼僅在 Windows Server 2012、2012 R2、2016、2019 和 2022 上進行了測試。

必要條件

如果使用範例指令碼且已升級,並且您要檢視作業系統物件的內容,必須重新執行以下步驟以監控作業系統。您必須再次下載協助程式指令碼,重新執行該指令碼,然後重新啟動自訂 Telegraf。

  • 確保已啟用網際網路。
  • 確認 PowerShell 為 4.0 或更新版本。若要檢查 PowerShell 版本,請在 PowerShell 中執行以下命令:

    $PSVERSIONTable

  • 確保雲端 Proxy 已在 VMware Aria Operations 中啟動並處於線上狀態。對於收集器群組,請確保已啟用應用程式監控高可用性的收集器群組中至少有一個雲端 Proxy 已在 VMware Aria Operations 中啟動並處於線上狀態。
  • 確保可從實體伺服器連線到 VMware Aria Operations 的連接埠 443。
  • 雲端 Proxy 目前僅支援 IPv4。
  • 端點虛擬機器/實體伺服器必須有權存取雲端 Proxy 的連接埠 8443 和 443 或已啟用應用程式監控高可用性的收集器群組的虛擬 IP。

程序

  1. 從以下位置下載範例指令碼:https://<cloudproxy_ip>/downloads/salt/telegraf-utils.ps1
    您可以在 PowerShell 終端機中執行以下命令之一:
    Invoke-WebRequest https://<cloudproxy_ip>/downloads/salt/telegraf-utils.ps1 -OutFile telegraf-utils.ps1 
    
    wget --no-check-certificate https://<cloudproxy_ip>/downloads/salt/telegraf-utils.ps1
    
    備註: 在先前指定的位置中,針對 <cloudproxy_ip> 使用相關的雲端 Proxy IP 位址。對於已啟用應用程式監控高可用性的收集器群組,請提供虛擬 IP。

    如果指令碼下載失敗並顯示以下訊息:請求已中止: 無法建立 SSL/TLS 安全通道,請按照Windows 平台指令碼下載失敗中所述的步驟進行操作。

  2. 從 Cloud Services 入口網站中的下列位置,建立與現有組織相關聯的使用者重新整理 Token。
    [使用者/組織設定] > [我的帳戶] > [API Token] > [產生新的 API Token]
  3. 執行範例指令碼以從雲端 Proxy 下載 Telegraf 二進位檔案,建立與 VMware Aria Operations 進行安全連線所需的憑證,並在 Telegraf 組態檔中進行必要的更新。
    telegraf-utils.ps1  user-managed -c cloud_proxy_ip_or_collector_group_name -t token -d telegraf_conf_dir (-v vmwareariaoperations_ip_or_fqdn | [-g gateway_url -a csp_auth_url]) [-x proxy -u proxy_user -p proxy_user_password]
        
    Description of arguments:
          -c : [REQUIRED] cloud_proxy_ip_or_collector_group_name - Cloud Proxy IP or Collector Group Name
          -t : [REQUIRED] token - This can be user_saas_refresh_token or on-prem vmwareariaoperations_auth_token.
                saas: CSP Refresh Token of the user/account. For getting new token, follow - User/
                      Organization Settings >> My Account >> API Tokens >> Generate a New API Token.
                      Example: gi7lwabjnvdfiawt4watzksuol8sywrjvg8kabh31mx9x1guepgyhycyx61dqrpq
                
          -d : [OPTIONAL] Agent installation directory. Default: current directory
          
          -g : [OPTIONAL] [SAAS-SPECIFIC] gateway_url - argument to override default VMware Aria Operations SaaS gateway URL
          -a : [OPTIONAL] [SAAS-SPECIFIC] csp_auth_url - argument to override default CSP authentication URL
          [-x proxy -u proxy_user -p proxy_user_password] :  [OPTIONAL] proxy - Proxy Server URL.It is in the form of <[protocol://]proxyhost[:proxyport]>
          Note: encode or escape proxy user and password correctly for proxy authentication.
    
    Example: .\telegraf-utils.ps1 user-managed -c 10.76.88.134 -t 41ef6601-6da3-4779-a51d-cbc08dd77355::4398b23d-e388-496e-ae91-bc04d5735345 -v 10.186.72.189
    
    
    如果環境位於企業 Proxy 後方,則指令碼會明確地將該 Proxy 視為外部連線。
    備註: 確保使用者名稱和密碼中的特殊字元為 HTTP 編碼或已正確逸出。
    備註: 預設閘道 URL 為 https://www.mgmt.cloud.vmware.com/vrops-cloud,預設驗證 URL 為 https://console.cloud.vmware.com/csp/gateway/am/api/auth/api-tokens/authorize。如果驗證 URL 和閘道 URL 不是預設設定,請提供相應引數 (-g 和 -a)。
    備註: 如果協助程式指令碼第一次執行因引數錯誤而失敗,請清除 Telegraf 資料夾,然後使用正確的引數重新執行該指令碼。
  4. 執行 Telegraf。
    telegraf.exe --config telegraf.conf --config-directory telegraf.d
    或者您可以讓 Telegraf 成為 Windows 服務。
    <Telegraf_executable_path> --config <Telegraf_config_file_path> --config-directory <Telegraf_config_directory_path> --service install
    net start telegraf
    
    例如:
    C:\VMware\UnManagedTelegraf\telegraf\telegraf.exe --config C:\VMware\UnManagedTelegraf\telegraf\telegraf.conf --config-directory C:\VMware\UnManagedTelegraf\telegraf\telegraf.d --service install
    net start telegraf
    

下一步

您可以從 VMware Aria Operations 使用者介面選取 相關物件 > 度量索引標籤,以檢視度量。
  1. 從左側面板中,導覽至環境 > 自訂群組
  2. 按一下右窗格中的作業系統環境物件。
  3. 導覽至度量索引標籤,然後選取對應的作業系統物件。