Example Generic Metric Collector Entity (Telegraf)

The following examples show how to define a generic metric collector entity representing a Telegraf agent that is locally monitored by a cloud agent on Unix and Windows.

Example: Unix and Unix-variants

{
  "entities":
  [
    {
      "name": "<Your name for the Telegraf collector>",
      "type": "omc_generic_metric_collector",
      "displayName": "<Your display name for the Telegraf collector>",
      "timezoneRegion": "<Your timezone>",
      "properties":
      {
        "host_name":
        {
          "displayName": "Host Name",
          "value": "<Your name of the host where Telegraf is installed>"
        },
 
        "omc_query_interface_path":
        {
          "displayName": "Query Interface Path",
          "value": "<Full path to the telegraf file. Eg. /usr/bin/telegraf>"
        },
 
        "omc_filter_expression":
        {
          "displayName": "Filter Expression",
          "value": "{$.[?(@.host=='<Value of the host tag in the metric payload sent by Telegraf>')]}"
        },
 
        "omc_auto_map":
        {
          "displayName": "Automatically Map Metrics",
          "value": "TRUE"
        },
 
        "capability":
        {
          "displayName": "capability",
          "value": "monitoring"
        },
 
        "omc_monitored":
        {
          "displayName": "Cloud Agent Monitored",
          "value": "TRUE"
        },
 
        "omc_product_name":
        {
          "displayName": "Product Name",
          "value": "telegraf"
        },
 
        "omc_product_vendor":
        {
          "displayName": "Product Vendor",
          "value": "InfluxData Inc."
        },
 
        "omc_product_version_query_arg":
        {
          "displayName": "Product Version Query Argument",
          "value": "--version"
        },
 
        "omc_product_version_regex":
        {
          "displayName": "Product Version Regular Expression",
          "value": "^Telegraf (.+) \\("
        },
 
        "omc_metrics_query_arg":
        {
          "displayName": "Metrics Query Argument",
          "value": "--test"
        },
    
        "omc_response_query_command":
        {
          "displayName": "Response Query Command",
          "value": "/sbin/service telegraf status"
        },
 
        "omc_use_exit_code_for_response":
        {
          "displayName": "Use exit code for response",
          "value": "TRUE"
        },
 
        "omc_protocol":
        {
          "displayName": "Protocol",
          "value": "https"
        },
 
        "omc_payload_format":
        {
          "displayName": "Payload Format",
          "value": "json"
        },
 
        "omc_receiver_uri_path":
        {
          "displayName": "Receiver URI Path",
          "value": "/emd/receiver/gmc"
        }
      }
    }
  ]
}

Example: Microsoft Windows

{
  "entities":
  [
    {
      "name": "<Your name for the Telegraf collector>",
      "type": "omc_generic_metric_collector",
      "displayName": "<Your display name for the Telegraf collector>",
      "timezoneRegion": "<Your timezone>",
      "properties":
      {
        "host_name":
        {
          "displayName": "Host Name",
          "value": "<Your name of the host where Telegraf is installed>"
        },
 
        "omc_query_interface_path":
        {
          "displayName": "Query Interface Path",
          "value": "<Full path to the telegraf.exe file escaping backslash characters. Eg., C:\\Program Files\\Telegraf\\telegraf.exe>"
        },
 
        "omc_filter_expression":
        {
          "displayName": "Filter Expression",
          "value": "{$.[?(@.host=='<Value of the host tag in the metric payload sent by Telegraf>')]}"
        },
 
        "omc_auto_map":
        {
          "displayName": "Automatically Map Metrics",
          "value": "TRUE"
        },
 
        "capability":
        {
          "displayName": "capability",
          "value": "monitoring"
        },
 
        "omc_monitored":
        {
          "displayName": "Cloud Agent Monitored",
          "value": "TRUE"
        },
 
        "omc_product_name":
        {
          "displayName": "Product Name",
          "value": "telegraf"
        },
 
        "omc_product_vendor":
        {
          "displayName": "Product Vendor",
          "value": "InfluxData Inc."
        },
 
        "omc_product_version_query_arg":
        {
          "displayName": "Product Version Query Argument",
          "value": "--version"
        },
 
        "omc_product_version_regex":
        {
          "displayName": "Product Version Regular Expression",
          "value": "^Telegraf (.+) \\("
        },
 
        "omc_metrics_query_arg":
        {
          "displayName": "Metrics Query Argument",
          "value": "--console --test"
        },
    
        "omc_response_query_command":
        {
          "displayName": "Response Query Command",
          "value": "sc query telegraf"
        },
   
        "omc_response_regex":
        {
          "displayName": "Response Regular Expression",
          "value": "STATE.*RUNNING"
        },
 
        "omc_protocol":
        {
          "displayName": "Protocol",
          "value": "https"
        },
 
        "omc_payload_format":
        {
          "displayName": "Payload Format",
          "value": "json"
        },
 
        "omc_receiver_uri_path":
        {
          "displayName": "Receiver URI Path",
          "value": "/emd/receiver/gmc"
        }
      }
    }
  ]
}

Note:

The metric auto-mapping functionality is enabled in this example by setting the omc_auto_map property to TRUE. Manual mapping of Telegraf metrics is not currently supported.

Use the omcli add_entity command to add the entity to the cloud agent.

omcli add_entity agent <entityDefinitionJsonFilePath>