可以使用指令碼在端點虛擬機器上安裝或解除安裝代理程式。

必要條件

  • 端點虛擬機器必須在 vRealize Operations Cloud 中可用。
  • 完成所有必要條件。如需詳細資訊,請參閱必要條件
  • 解壓縮套件必須在端點虛擬機器上可用。
  • 使用者必須具有下載資料夾的存取權限。
  • 客體 IP 必須已正確設定,並且應該在 vCenter Server 之間是唯一的。如果在 vCenter Server 中監控的端點虛擬機器不只一台具有相同 IP,則指令碼無法解析及訂閱應用程式監控。
  • 必須已為端點虛擬機器所屬的 vCenter Server 設定雲端帳戶。建立對應至 vCenter Server 的應用程式監控介面卡 (如果尚未存在)。
  • 確保已啟用網際網路。
  • 使用者必須具有以下權限:
    • 管理 > REST-API > 所有其他讀取、寫入 API
    • 管理 > REST-API > 對 API 的讀取存取權
    • 環境 > 應用程式 > 管理 Telegraf 代理程式
    • 環境 > 動作 > 啟動載入虛擬機器
    • 環境 > 動作 > 下載執行啟動程序
    備註: 若要檢查權限,請導覽到 管理 > 存取控制 > 角色,選取指派給使用者的角色。可以在頁面結尾處的右側檢視權限。
  • 目前只支援 IPv4。
  • VMTools 版本必須 >=10.2。

程序

  1. 登入您要安裝/解除安裝代理程式的端點虛擬機器,然後從雲端 Proxy 的下列位置下載範例指令碼:https://<CloudProxy>/downloads/salt/download.sh。執行下列其中一個指令:
    wget --no-check-certificate “https://<CloudProxy>/downloads/salt/download.sh”
    curl -k “https://<CloudProxy>/downloads/salt/download.sh” --output download.sh
    備註: 在上述指定命令和位置中使用 <CloudProxy> 的相關雲端 Proxy IP 位址/FQDN。對於已啟用應用程式監控高可用性的收集器群組,請提供虛擬 IP。
  2. 執行下列命令,使指令碼變為可執行:
    chmod +x download.sh
  3. 從雲端服務入口網站的下列位置建立與目前組織相關聯的使用者重新整理 Token:使用者/組織設定 > 我的帳戶 > API Token > 產生新的 API Token
  4. 若要執行指令碼並安裝/解除安裝代理程式,請執行下列指令:
    download.sh -o operation -t user_saas_refresh_token -c cloud_proxy_ip_or_collector_group_name [-d download_tmp_dir -s sleep_seconds -i list_of_IPs]
    
    Description of arguments:
    operation - Bootstrap operation. values: install, uninstall.
    user_saas_refresh_token - CSP Refresh Token of the user/account. For getting new token, follow - "User/Organization Settings >> My Account >> API Tokens >> Generate a New API Token". It's a mandatory parameter.
    Example: gi7lwabjnvdfiawt4watzksuol8sywrjvg8kabh31mx9x1guepgyhycyx61dqrpq
    cloud_proxy_ip_or_collector_group_name - Cloud Proxy IP on which the AppOS Adapter instance will be created or the name of the application monitoring high availability activated collector group.
    download_tmp_dir - Temporary directory to download agent related bits. It's an optional parameter. Default value: current directory
    sleep_seconds - Time (in seconds) to delay the script execution. This optional parameter will be helpful when this script is used in vRA to have agent installed on deploying VM. Recommended time 600 seconds.
    list_of_IPs - This is an optional parameter. Comma separated IPs that are set as properties of a VM in vROps (VM -> Properties -> Network -> <Integer> -> IP Address). If single adapter has multiple IP Addresses then delimit them using '_'
    Example:- If your VM has 3 adapters with the following IP Addresses: Adapter1: 10.0.0.1 Adapter2: 10.0.0.2 & 10.0.0.3 Adapter3: 10.0.0.4
    Then this parameter should be given as "10.0.0.1,10.0.0.2_10.0.0.3,10.0.0.4"
    
    備註: 若要執行協助程式指令碼,必須使用 -c 引數。
    若要驗證執行啟動程序狀態,請檢視 uaf-bootstrap-results 檔案。如果安裝失敗,請在 uaf_bootstrap.log 中尋找錯誤訊息。

    如果指令碼成功,則在完成一次約需 5–10 分鐘的收集循環後,將會在管理 Telegraf 代理程式索引標籤中更新代理程式狀態。

    備註: 當您使用自動化指令碼時,可支援批次大小為 20 的同時代理程式安裝。