You can run Windows services and Linux processes 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.
    • Configuration Details for Windows Service (via executable name):
      # Monitor process cpu and memory usage
      [[inputs.procstat]]
      
      ## Windows service name
      win_service = "Dhcp"
      pid_finder = "native"
      
      fieldpass =  ["running", "cpu_usage", "memory_usage"]
      [inputs.procstat.tags]
      search_pattern = "exec_Dhcp"
      
      [[inputs.win_services]]
      service_names = ["Dhcp"]
      name_override="procstat"
      
      [inputs.win_services.tags]
      search_pattern = "exec_Dhcp"
    • Configuration Details for Linux Processes (via regular expression):
      # Monitor process cpu and memory usage
      [[inputs.procstat]]
      ## pattern as argument for pgrep (ie, pgrep -f <pattern>)
      pattern = ".*ucp-.*"
      
      fieldpass =  ["running", "cpu_usage", "memory_usage"]
      [inputs.procstat.tags]
      search_pattern = "regex_.#!AsTeRiSk!#ucp-.#!AsTeRiSk!#"
    • Configuration Details for Linux Processes (via executable name):
      # Monitor process cpu and memory usage
      [[inputs.procstat]]
      ## executable name (ie, pgrep <exe>)
      exe = "top"
      fieldpass =  ["running", "cpu_usage", "memory_usage"]
      [inputs.procstat.tags]
      
      search_pattern = "exec_top"
    • Configuration Details for Linux Processes (via process ID):
      # Monitor process cpu and memory usage
      [[inputs.procstat]]
      ## PID file to monitor process
      pid_file = "/var/run/vmtoolsd.pid"
      
      fieldpass =  ["running", "cpu_usage", "memory_usage"]
      [inputs.procstat.tags]
      
      search_pattern = "pidfile_/var/run/vmtoolsd.pid"
  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 Processes and Services objects.