You can use a sample script to monitor operating systems in physical servers.

The sample script is tested only on Windows Server 2012, 2012 R2, 2016, 2019, and 2022.

Prerequisites

If you are using the sample script and have upgraded, and you want to view the properties of the operating system objects, you must perform the following steps again to monitor operating systems. You must download the helper script again, rerun it, and then restart custom Telegraf.

  • Ensure that the Internet is enabled.
  • Verify that PowerShell is at 4.0 or above. To check the PowerShell version, run the following in PowerShell:

    $PSVERSIONTable

  • Verify that OpenSSL is at 1.1.1 or above. Download from https://slproweb.com/products/Win32OpenSSL.html. To check the OpenSSL version run the following in PowerShell:

    openssl.exe version

  • Ensure that cloud proxy is up and online in vRealize Operations Cloud.
  • Ensure that cloud proxy is reachable from the physical server.

Procedure

  1. Download the sample script from the following location: https://<cloudproxy_ip>/downloads/salt/unmanagedagent_setup_sample.ps1
    You can run one of the following commands in the PowerShell terminal:
    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
    

    If the script download fails with the following message: The request was aborted: Could not create SSL/TLS secure channel, follow the steps mentioned in Script Download Fails on a Windows Platform.

    Note: Use the relevant cloud proxy IP address for <cloud-proxy> in the preceding location specified.
  2. Create the user's refresh token associated with the current organization from the following location in the Cloud Service portal.
    User/Organization Settings > My Account > API Tokens >> Generate a New API Token
  3. Run the sample script to download the Telegraf binary files from cloud proxy, create necessary certificates for a secure connection with vRealize Operations Cloud, and make necessary updates in Telegraf configuration files.
    .\unmanagedagent_setup_sample.ps1 -t <refresh_token_from_previous_step> -c <cloudproxy_ip> -d <Telegraf_Download_Directory>
    Example:
    .\unmanagedagent_setup_sample.ps1 -t UO2HafB0JMYiMmnppZIo2Zn5jCdDf1YeIXa0E7JXUPoUXF5HN6SK29kdJUibcJMg -c 10.192.0.158 -d C:/TelegrafDownloadDirectory
    If the environment is behind a corporate proxy, the script considers the proxy explicitly for external connections.
    Note: Ensure that the special characters in the user name and password are either http encoded or escaped correctly. For example:
    .\unmanagedagent_setup_sample.ps1 -t <refresh_token_from_previous_step> -c <cloudproxy_ip> -d <Telegraf_Download_Dir> -x http://<proxyIp>:<proxyPort> -u <proxyUser> -p <proxyPassword>
    Description of arguments:

    refresh_token_from_previous_step: Refresh token of the user that was generated in the previous step.

    cloudproxy_ip: IP of Cloud Proxy. Mandatory parameter.

    Telegraf_Download_Directory: Where to install agent? Optional parameter. Default value: current directory.

    proxy: Proxy Server URL. Optional parameter.

    Note: If helper script execution fails for the first time due to wrong arguments, clear the Telegraf folder and rerun the script once more with the right arguments.
  4. Run Telegraf.
    telegraf.exe --config telegraf.conf --config-directory telegraf.d
    Or you can make Telegraf a Windows service.
    <Telegraf_executable_path> --config <Telegraf_config_file_path> --config-directory <Telegraf_config_directory_path> --service install
    net start telegraf
    
    For example:
    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
    

What to do next

You can view metrics by selecting the relevant object > Metrics tab from the vRealize Operations Cloud user interface.
  1. From the left panel, navigate to Environment > Custom Groups.
  2. Click the Operating System World object in the right pane.
  3. Navigate to the Metrics tab and select the corresponding OS object.