The Invoke-WebRequest
or wget --no-check-certificate
commands fails with "Could not establish trust relationship for the SSL/TLS secure channel"
This article provides step-by-step instructions to install the Telegraf agent on a windows based physical server for monitoring purposes in VMware Aria Operations.
VMware Aria Operations 8.12.x and Later
Downloading and installing the Telegraf agent fails due to certificate validation issues or network restrictions.
Run the following PowerShell script to bypass certificate validation:
if (-not ([System.Management.Automation.PSTypeName]'ServerCertificateValidationCallback').Type)
{
$certCallback = @"
using System;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
public class ServerCertificateValidationCallback
{
public static void Ignore()
{
if(ServicePointManager.ServerCertificateValidationCallback ==null)
{
ServicePointManager.ServerCertificateValidationCallback +=
delegate
(
Object obj,
X509Certificate certificate,
X509Chain chain,
SslPolicyErrors errors
)
{
return true;
};
}
}
}
"@
Add-Type $certCallback
}
[ServerCertificateValidationCallback]::Ignore()
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Download the Telegraf Agent Installation Script
Run the following PowerShell command:
Invoke-WebRequest "https://<CloudProxy-fqdn/IP>/downloads/salt/telegraf-utils.ps1" -OutFile telegraf-utils.ps1
Execute the Installation Script
Run the script with the required parameters:
.\telegraf-utils.ps1 product-managed -c <cloud_proxy_ip_or_collector_group_name> -t <token> -v <vmwareariaoperations_ip_or_fqdn>
Retrieve the Token for Script Execution
https://<vrops-fqdn>/ui
Admin
credentials.The above action should trigger telegraf agent installation on the server and the 'Agent Running' status should be seen under 'Manage Telegraf Agent' section.