You can run remote checks such as Ping, TCP, and HTTP in physical servers and collect custom data, which can then be consumed as a metric.

Procedure

  1. Update the Telegraf configuration in the target physical server after running the sample script. Add the following in the http.conf file.
    • For Ping check:
      [[inputs.ping]]
      ## Hosts to send ping packets to.
      urls = ["www.vmware.com"]
      
      ## Number of ping packets to send per interval.  Corresponds to the "-c"
      ## option of the ping command.
      # count = 1
      
      ## Time to wait between sending ping packets in seconds.  Operates like the
      ## "-i" option of the ping command.
      # ping_interval = 1.0
      
      ## If set, the time to wait for a ping response in seconds.  Operates like
      ## the "-W" option of the ping command.
      # timeout = 1.0
      
      ## If set, the total ping deadline, in seconds.  Operates like the -w option
      ## of the ping command.
      # deadline = 10
      
      ## Interface or source address to send ping from.  Operates like the -I or -S
      ## option of the ping command.
      # interface = ""
    • For TCP check:
      [[inputs.net_response]]
      name_override="netresponse"
      ## Server address (default localhost)
      address = "10.10.10.10:443"
      protocol = "tcp"
      
      ## Set timeout
      # timeout = "1s"
      
      ## Set read timeout (only used if expecting a response)
      # read_timeout = "1s"
      
    • For HTTP check:
      # HTTP/HTTPS request given an address a method and a timeout
      [[inputs.http_response]]
      name_override="httpresponse"
      ## List of url to query.
      address = https://10.10.10.10/suite-api/api/adapters
      method = "GET"
      
      ## Set http_proxy.
      ## Telegraf uses the system wide proxy settings if it's is not set.
      # http_proxy = http://localhost:8888
      
      ## Set response_timeout (default 5 seconds)
      # response_timeout = "5s"
      
      ## Whether to follow redirects from the server (defaults to false)
      # follow_redirects = false
      
      ## Optional name of the field that will contain the body of the response.
      ## By default it is set to an empty String indicating that the body's content won't be added
      # response_body_field = ''
      
      ## Optional substring or regex match in body of the response (case sensitive)
      # response_string_match = "\"service_status\": \"up\""
      # response_string_match = "ok"
      # response_string_match = "\".*_status\".?:.?\"up\""
      
      
      ## Optional SSL Config
      # ssl_ca = "/etc/telegraf/ca.pem"
      # ssl_cert = "/etc/telegraf/cert.pem"
      # ssl_key = "/etc/telegraf/key.pem"
      
      
      ## Use SSL but skip chain & host verification
      insecure_skip_verify = true
      
      ## HTTP Request Headers (all values must be strings)
      [inputs.http_response.headers]
      accept = "application/json" Authorization = "OpsToken a16f7a2b-b033-48bc-9827-2daf8e205537::ec11ee5f-8623-4558-a904-8b4ea3f6f47d"
  2. Restart Telegraf and wait for 10 minutes to get the data.

What to do next

You can view metrics by selecting the relevant object from the Metrics tab from the VMware Aria Operations user interface:
  1. From the left panel, navigate to Environment > Custom Groups.
  2. Click on the Operating System World object in the right pane.
  3. Navigate to the Metrics tab and select the corresponding OS object.
  4. Under OS object you will find the Ping, TCP, and HTTP objects.