可以使用指令碼在端點虛擬機器上安裝或解除安裝代理程式。
程序
- 登入您要安裝/解除安裝代理程式的端點虛擬機器,然後從雲端 Proxy 的下列位置下載範例指令碼:https://<CloudProxy>/downloads/salt/telegraf-utils.ps1 。
執行下列其中一個指令:
PowerShell command:
Invoke-WebRequest "https://<CloudProxy>/downloads/salt/telegraf-utils.ps1" -OutFile telegraf-utils.ps1
Or if you have the wget tool:
wget --no-check-certificate https://<CloudProxy>/downloads/salt/telegraf-utils.ps1
備註: 在上述指定命令和位置中使用 <CloudProxy> 的相關雲端 Proxy
IP 位址。對於已啟用應用程式監控高可用性的收集器群組,請提供虛擬 IP。
- 從雲端服務入口網站的下列位置建立與目前組織相關聯的使用者重新整理 Token:使用者/組織設定 > 我的帳戶 > API Token >> 產生新的 API Token
- 若要執行指令碼並安裝/解除安裝代理程式,請執行下列指令:
telegraf-utils.ps1 product-managed -c cloud_proxy_ip_or_collector_group_name -t token (-v vmwareariaoperations_ip_or_fqdn | [-g gateway_url -a csp_auth_url]) [-d download_tmp_dir -s sleep_seconds -i list_of_IPs -o operation]
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] download_tmp_dir - Temporary directory for agent installation. 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
-o : [OPTIONAL] operation - The type of operation to be performed {install,uninstall} Default: install
-s : [OPTIONAL] 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.
-i : [OPTIONAL] list_of_IPs - This is an optional parameter. Comma separated IPs that are set as properties of a VM in VMware Aria Operations (VM -> Properties -> Network -> <Integer> -> IP Address). If single adapter has multiple IP Addresses, then delimit them using '_'
ex:- If your VM has 3 adapters with IP Address as follows: 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"
Example: .\telegraf-utils.ps1 product-managed -t 8dab02cc-265c-4392-b910-bd2e89c7e741::8bcde100-6318-44d7-a8dc-11f4ff84b3b -v 10.10.10.100 -c 10.10.10.101
備註: 若要執行協助程式指令碼,必須使用
-c
引數。
備註: 預設閘道 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)。
若要驗證執行啟動程序狀態,請檢視
uaf-bootstrap-results 檔案。如果安裝失敗,請在
uaf_bootstrap.log 中尋找錯誤訊息。
如果指令碼成功,則在完成一次約需 5–10 分鐘的收集循環後,將會在管理 Telegraf 代理程式索引標籤中更新代理程式狀態。
備註: 當您使用自動化指令碼時,可支援批次大小為 20 的同時代理程式安裝。