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 = https://repos.influxdata.com/rhel/\$releasever/\$basearch/stable
enabled = 1
gpgcheck = 1
gpgkey = https://repos.influxdata.com/influxdb.key
command to install and run telegraf service
|sudo yum install telegraf|
sudo systemctl start telegraf
- Download and import InfluxData’s public key:
2.Download the signature file for the release by adding
.asc to the download URL.
3. Verify the signature with
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.
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 (
Global Tags :
can be specified in
[global_tags] section of the config file in
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.
same way we can configure.
you can get all information about all avialable telegraf plugins and other information about telegraf from below location
Please visit related topics.