Skip to content

 Threejs and TypeScript
 SocketIO and TypeScript
 Blender Topological Earth
 Sweet Home 3D
 Design Patterns Python
 Design Patterns TypeScript
 Course Coupon Codes
Three.js and TypeScript
Kindle Edition
$9.99 $14.99 Paperback 
$29.99 $34.99

Design Patterns in TypeScript
Kindle Edition
$9.99 $14.99 Paperback
$19.99 $24.99

Design Patterns in Python
Kindle Edition
$9.99 $14.99 Paperback
$19.99 $24.99

Install Telegraf and configure for InfluxDB

Video Lecture

Install Telegraf and configure for InfluxDB Install Telegraf and configure for InfluxDB Install Telegraf and configure for InfluxDB


Now to install the Telegraf agent and configure the output plugin to save data into the InfluxDB2.

The install commands for your OS are at

For these instructions, I have chosen Telegraf v1.20.4 version and the Ubuntu & Debian platform.

Download the package.


Install it using the package manager.

sudo dpkg -i telegraf_1.20.4-1_amd64.deb

It is normally started by default. We can check its status.

sudo service telegraf status

If it isn't started, then you can start it.

sudo service telegraf start

CD into the new Telegraf folder

cd /etc/telegraf

Create a backup of the existing Telegraf config.

cp telegraf.conf telegraf.conf.bak

Delete the telegraf.conf

rm telegraf.conf

Create a new telegraf.conf

sudo nano telegraf.conf

Paste this minimal configuration text into it.

  interval = "10s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "0s"
  flush_interval = "10s"
  flush_jitter = "0s"
  precision = ""
  hostname = ""
  omit_hostname = false

  urls = [""]
  organization = "YOUR ORG NAME"
  bucket = "telegraf"

  percpu = true
  totalcpu = true
  collect_cpu_time = false
  report_active = false
  ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs"]

Replace "YOUR TELEGRAF READ/WRITE TOKEN" above with the token created using the technique as shown in the video.

Replace "YOUR ORG NAME" with the organization that you created earlier.

Restart Telegraf and check it's status.

sudo service telegraf restart
sudo service telegraf status

InfluxDB should now be able to query some extra metrics and you should be able to also query them in Grafana as demonstrated in the video.

Example flux query

from(bucket: "telegraf")
  |> range(start: v.timeRangeStart, stop:v.timeRangeStop)
  |> filter(fn: (r) =>
    r._measurement == "cpu"
    and r._field == "usage_user"

InfluxDB Manage API tokens