Install and Configure Telegraf on Debian 11 / Debian 10

Posted on 367 views

Telegraf is a monitoring agent application developed by InfluxData as part of Tick Stack. This application is written in Go and is used for collecting system performance metrics. Telegraf can collect metrics from a wide array of inputs and write them into a wide array of outputs. It is plugin-driven for both collection and output of data so it is easily extendable.

With over 200+ plugins available written by subject matter experts on the data in the community, it is easy to start collecting metrics from your end-points. You can easily add new inputs and outputs to suit your monitoring desires.

How To Install Telegraf on Debian 11 / Debian 10

In this guide, I’ll show you how to install and configure Telegraf on Debian 10 (Buster) Linux system.

Step 1: Update System

Update your Debian system.

sudo apt update && sudo apt -y upgrade

Step 2: Add Influxdata repository

The pre-packaged Go binaries for Telegraf are available on Influxdata repository.

Import repository GPG key.

sudo apt install wget curl gnupg2 lsb-release ca-certificates apt-transport-https software-properties-common -y
wget -qO- | sudo apt-key add -

Add InfluxDB APT repository using the command below.

echo "deb $(lsb_release -cs) stable"|sudo tee /etc/apt/sources.list.d/influxdb.list

Once the repository is added, install Telegraf on Debian 10 (Buster).

sudo apt update
sudo apt install telegraf

Step 3: Configure Telegraf on Debian 11 / Debian 10

Start and enable telegraf service.

$ systemctl status telegraf
 telegraf.service - The plugin-driven server agent for reporting metrics into InfluxDB
     Loaded: loaded (/lib/systemd/system/telegraf.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2022-04-20 10:28:31 UTC; 21s ago
   Main PID: 26846 (telegraf)
      Tasks: 8 (limit: 2340)
     Memory: 25.7M
        CPU: 219ms
     CGroup: /system.slice/telegraf.service
             └─26846 /usr/bin/telegraf -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d

Apr 20 10:28:31 telegraf[26846]: 2022-04-20T10:28:31Z I! Loaded processors:
Apr 20 10:28:31 telegraf[26846]: 2022-04-20T10:28:31Z I! Loaded outputs: influxdb

The main configuration file for telegraf is /etc/telegraf/telegraf.conf. Most sections are commented out, but you can uncomment to unlock the inputs, outputs and configurations you wish to use.

We have a guide on monitoring of Linux system with Telegraf and Grafana:

This requires InfluxDB and Grafana installed, use below guides:

Gravatar Image
A systems engineer with excellent skills in systems administration, cloud computing, systems deployment, virtualization, containers, and a certified ethical hacker.