您可以使用示例脚本监控物理服务器中的操作系统。

仅在 Windows Server 2012、2012 R2、2016、2019 和 2022。

前提条件

如果使用示例脚本并且已升级,要查看操作系统对象的属性,必须重新执行以下步骤以监控操作系统。您必须再次下载帮助程序脚本,重新运行该脚本,然后重新启动自定义 Telegraf。

  • 确认 PowerShell 为 4.0 或更高版本。要检查 PowerShell 版本,请在 PowerShell 中运行以下命令:

    $PSVERSIONTable

  • 确认 OpenSSL 为 1.1.1 或更高版本。从 https://slproweb.com/products/Win32OpenSSL.html 下载。要检查 OpenSSL 版本,请在 PowerShell 中运行以下命令:

    openssl.exe version

  • 确保云代理已在 vRealize Operations 中启动并处于联机状态。
  • 确保可从物理服务器访问云代理。
  • 确保可从物理服务器访问 vRealize Operations 的端口 443。

过程

  1. 从以下位置下载示例脚本:https://<cloudproxy_ip>/downloads/salt/unmanagedagent_setup_sample.ps1
    您可以在 PowerShell 终端中运行以下命令之一:
    Invoke-WebRequest https://<cloudproxy_ip>/downloads/salt/unmanagedagent_setup_sample.ps1 -OutFile unmanagedagent_setup_sample.ps1
    
    wget --no-check-certificate https://<cloudproxy_ip>/downloads/salt/unmanagedagent_setup_sample.ps1
    

    如果脚本下载失败并显示以下消息:请求已中止: 无法创建 SSL/TLS 安全通道 (The request was aborted: Could not create SSL/TLS secure channel),请按照在 Windows 平台上下载脚本失败中所述的步骤执行操作。

    注: 在上述指定位置中为 <cloud-proxy> 使用相关的云代理 IP 地址。
  2. 运行示例脚本以从云代理下载 Telegraf 二进制文件,创建与 vRealize Operations 建立安全连接所需的证书,并在 Telegraf 配置文件中进行必要的更新。
    unmanagedagent_setup_sample.ps1 -v <vrops_ip_or_fqdn> -a <vrops_user> -b <vrops_password> -c <cloudproxy_ip> -d <Telegraf_Download_Directory> 
    例如:
    unmanagedagent_setup_sample.ps1 -v 10.192.0.189 -a admin -b Password!23 -c 10.192.0.158 -d C:/TelegrafDownloadDirectory 
    如果环境处于企业代理之后,脚本会将该代理显式地视为外部连接的代理。
    注: 确保用于代理身份验证的用户名和密码中的特殊字符已正确编码或转义:
    unmanagedagent_setup_sample.ps1 -v <vrops_ip_or_fqdn> -a <vrops_user> -b <vrops_password> -c <cloudproxy_ip> -d <Telegraf_Download_Directory> -x <[protocol://]proxyhost[:proxyport]> -u <proxyUser> -p <proxyPassword>
    参数说明:

    vrops_ip_or_fqdn:vRealize Operations 的 IP 或 FQDN。必需参数。

    vrops_user:要进行 suite-api 调用的 vRealize Operations 的用户名。必需参数。

    vrops_password:要进行 suite-api 调用的 vRealize Operations 的密码。必需参数。

    cloudproxy_ip:云代理的 IP。必需参数。

    Telegraf_Download_Directory:代理安装位置。可选参数。默认值:当前目录。

    proxy:代理服务器 URL。可选参数。

    注: 如果帮助程序脚本第一次由于参数错误而失败,请清除 Telegraf 文件夹,然后使用正确的参数重新运行该脚本。
  3. 运行 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
    

下一步做什么

您可以通过从 vRealize Operations 用户界面中选择 相关对象 > 衡量指标选项卡来查看衡量指标。
  1. 从左侧菜单中,导航到环境 > 自定义组
  2. 单击右侧窗格中的操作系统环境对象。
  3. 导航到衡量指标选项卡,然后选择相应的操作系统对象。