Telegraf Relay

How to configure Telegraf relay to forward data to Cloud Connector
Written by Kristaps
Updated 8 months ago

Telegraf can be retrieved and downloaded from the official release page based on your system and environment.

On a Linux system it usually installs under /etc/telegraf and the main configuration file is /etc/telegraf/telegraf.conf

To enable relay functionality and to forward data from your local telegraf instance adjust the configuration in /etc/telegraf/telegraf.conf based on the following steps.

Linux Example: Locate and change

  url = ""
  data_format = "graphite"
  graphite_tag_support = true
  prefix = "opvagent" # or winagent for Windows
    X-API-KEY = "<your Opvizor/Cloud API key>"


  servers = [""]
  prefix = "opvagent" # or winagent for Windows
  graphite_tag_support = true

!!! Note that the IP has to be adjusted to match with the one for your Cloud Connector instance.
Also important to change the prefix depending on the data you want to ship, i. e. Windows is prefix = "winagent"

Here's an example of complete Telegraf configuration forwarding the Linux integration to the Cloud Connector instance

# Global tags can be specified here in key="value" format.
  # dc = "us-east-1" # will tag all metrics with dc=us-east-1
  # rack = "1a"
  ## Environment variables can be used as tags, and throughout the config file
  # user = "$USER"

# Configuration for telegraf agent
  interval = "60s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "0s"
  flush_interval = "10s"
  flush_jitter = "0s"
  precision = ""
  debug = false
  quiet = false
  logfile_rotation_max_size = "20MB"
  logfile_rotation_max_archives = 5
  hostname = ""
  omit_hostname = false


# Configuration for influxdb server to send metrics to
  servers = [""]
  prefix = "opvagent"
  graphite_tag_support = true

# Read metrics about cpu usage
  ## Whether to report per-cpu stats or not
  percpu = true
  ## Whether to report total system cpu stats or not
  totalcpu = true
  ## Comment this line if you want the raw CPU time metrics
  fielddrop = ["time_*"]

# Read metrics about disk usage by mount point
  ## By default, telegraf gather stats for all mountpoints.
  ## Setting mountpoints will restrict the stats to the specified mountpoints.
  # mount_points = ["/"]

  ## Ignore some mountpoints by filesystem type. For example (dev)tmpfs (usually
  ## present on /run, /var/run, /dev/shm or /dev).
  ignore_fs = ["tmpfs", "devtmpfs"]

# Read metrics about disk IO by device
  ## By default, telegraf will gather stats for all devices including
  ## disk partitions.
  ## Setting devices will restrict the stats to the specified devices.
  devices = ["sd*", "hd*", "nvme*", "mdadm*", "md*"]
  ## Uncomment the following line if you need disk serial numbers.
  # skip_serial_number = false

# Get kernel statistics from /proc/stat
  # no configuration

# Read metrics about memory usage
  # no configuration

# Get the number of processes and group them by status
  # no configuration

# Read metrics about swap memory usage
  # no configuration

# Read metrics about system load & uptime
  # no configuration

# Read metrics about network interface usage
  # collect data only about specific interfaces
  interfaces = ["eth*", "en*", "wla*"]

  # no configuration

  # no configuration

  # no configuration

Make sure that you've restarted the Telegraf agent after you've made the changes. The data should flow within a minute or two.

Finally enable the relay receiver on the Cloud Connector by toggle switch.

Did this answer your question?