• Porto, Portugal
Tecnologias da Informação
Install and Configure Telegraf on Debian 10/11

Install and Configure Telegraf on Debian 10/11

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.

Step 1: Update System

Update your Debian system.

apt update && apt -y upgrade

Step 2: Add Influxdata repository

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

Import repository GPG key.

apt install wget curl gnupg2 lsb-release ca-certificates apt-transport-https software-properties-common -y
wget -qO- https://repos.influxdata.com/influxdb.key | apt-key add -

Add InfluxDB APT repository using the command below.

echo "deb https://repos.influxdata.com/debian $(lsb_release -cs) stable"|tee /etc/apt/sources.list.d/influxdb.list

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

apt update
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
       Docs: https://github.com/influxdata/telegraf
   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 blog.example.com telegraf[26846]: 2022-04-20T10:28:31Z I! Loaded processors:
Apr 20 10:28:31 blog.example.com 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.

telegraf – config sample for linux

Tags :