可以使用脚本在端点虚拟机上安装或卸载代理。

前提条件

  • 端点虚拟机必须在 vRealize Operations Cloud 中可用。
  • 完成所有必备条件。有关详细信息,请参见 必备条件
  • 解压缩软件包必须在端点虚拟机上可用。
  • 用户必须具有下载文件夹的访问权限。
  • 客户机 IP 必须已正确配置,并且应在 vCenter Server 之间唯一。如果监控多个在 vCenter Server 之间具有相同 IP 的端点虚拟机,则脚本将无法解析和订阅应用程序监控。
  • 必须已为端点虚拟机所属的 vCenter Server 配置云帐户。如果映射到 vCenter Server 的应用程序监控适配器不存在,则会创建该适配器。
  • 确保已启用 Internet。
  • 用户必须具有以下权限:
    • 系统管理 > REST-API > 所有其他读取、写入 API
    • 系统管理 > REST-API > 对 API 的读取访问权限
    • 环境 > 应用程序 > 管理 Telegraf 代理
    • 环境 > 操作 > 引导虚拟机
    • 环境 > 操作 > 下载引导程序
    注: 要检查权限,请导航到 系统管理 > 访问控制 > 角色,选择分配给用户的角色。可以在页面末尾右侧查看权限。
  • 目前仅支持 IPv4。
  • VMTools 版本必须 >= 10.2。

过程

  1. 登录到要在其上安装/卸载代理的端点虚拟机,并通过云代理从以下位置下载示例脚本:https://<CloudProxy>/downloads/salt/download.ps1
    如果脚本下载失败并显示以下消息: 请求已中止: 无法创建 SSL/TLS 安全通道 (The request was aborted: Could not create SSL/TLS secure channel),请按照 在 Windows 平台上下载脚本失败中所述的步骤执行操作。
    运行以下命令之一:
    PowerShell command:
    Invoke-WebRequest "https://<CloudProxy>/downloads/salt/download.ps1" -OutFile download.ps1
    
    Or if you have the wget tool:
    wget --no-check-certificate https://< CloudProxy >/downloads/salt/download.ps1
    注: 在上述指定命令和位置中使用 <CloudProxy> 的相关云代理 IP 地址/FQDN。对于已激活应用程序监控高可用性的收集器组,请提供虚拟 IP。
  2. 在云服务门户中,从以下位置创建与当前组织关联的用户刷新令牌:用户/组织设置 > 我的帐户 > API 令牌 > 生成新的 API 令牌
  3. 要执行脚本并安装/卸载代理,请运行以下命令:
    download.ps1 -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 的并发代理安装。