How To Install Telegraf on centOS 8

Telegraf is a plugin-driven server agent for collecting and sending metrics and events from databases, systems, and IoT sensors.

Telegraf is written in Go and compiles into a single binary with no external dependencies, and requires a very minimal memory footprint.


Install Telegraf on centOS 8

first update centOS 8 system

sudo dnf update

there are 2 ways to install Telegraf on system manually and using yum package manager

step 1. Add Influxdata RPM repository:

Telegraf is created by influxDB organisation, if we configured influx DB repository we can install both applications.

cat <<EOF | sudo tee /etc/yum.repos.d/influxdb.repo
name = InfluxDB Repository – RHEL \$releasever
baseurl =\$releasever/\$basearch/stable
enabled = 1
gpgcheck = 1
gpgkey =

command to install and run telegraf service

sudo yum install telegraf
sudo systemctl start telegraf
  1. Download and import InfluxData’s public key:
curl -sL | gpg --import

2.Download the signature file for the release by adding .asc to the download URL.


3. Verify the signature with gpg --verify

gpg --verify telegraf-1.14.1_linux_amd64.tar.gz.asc telegraf-1.14.1_linux_amd64.tar.gz

Telegraf configuration

All plugins are available in configuration file , most of them are commented , we need to uncomment and use them.

the default locations are /etc/telegraf/telegraf.conf for the main configuration file and /etc/telegraf/telegraf.d for the directory of configuration files.

you can create your own telegraf confguration file with current configuration using below command. you can make modification in it as use it as per your requirement.below command will create new configuration file in current working directory.

telegraf config > telegraf.conf

if you want to create configuration file with specific inputs and outputs , run below command.

telegraf –input-filter <pluginname>[:<pluginname>] –output-filter <outputname>[:<outputname>] config > telegraf.conf

set Evironment variables

 we can set Telegraf environment variables in this file (/etc/default/telegraf):


Global Tags :

can be specified in[global_tags] section of the config file in key="value" format.

Input configuration:

config parameter to set in INPUT section

  • interval: How often to gather this metric.
  • name_override: Override the base name of the measurement. (Default is the name of the input).
  • name_prefix: Specifies a prefix to attach to the measurement name.
  • name_suffix: Specifies a suffix to attach to the measurement name.
  • tags: A map of tags to apply to a specific input’s measurements.
percpu = true
totalcpu = false
# filter all fields beginning with 'time_'
fielddrop = ["time_*"]

same way we can configure.

OUTPUT configuration

Aggregator configuration

Processor configuraton

you can get all information about all avialable telegraf plugins and other information about telegraf from below location


Please visit related topics.


Please enter your comment!
Please enter your name here

Latest articles