Skip to content

Telegraf Installation Guide

1. Introduction

This guide presents the installation of Telegraf, a metrics collection tool that will be used in the br-lab laboratory. Telegraf provides support for various protocols and plugins for collecting metrics, allowing its integration with different systems and devices. The installation uses Docker Compose to automatically provision the necessary services, ensuring a practical and efficient implementation in the laboratory environment.


2. What is Telegraf?

Telegraf is a highly configurable metrics collection agent developed by InfluxData. It is compatible with a wide variety of protocols and plugins, which makes it possible to capture and process metrics from systems, devices, applications, and services in real-time.

Main Components:

  1. Telegraf: Configurable data collection agent.
  2. InfluxDB: Time series database where Telegraf data will be stored.
  3. Grafana: Tool for visualization and analysis of collected data.
  4. Chronograf: Additional graphical interface for querying and analyzing data in InfluxDB.

This architecture integrates metric capture, storage, and visualization, ensuring flexibility and efficiency in monitoring the environment.


3. Prerequisites

Make sure you meet the following prerequisites before installation:

  1. br-lab network configured:

  2. Required Packages:

    • docker, docker-compose, curl.

4. Preparing the Environment

4.1. Downloading the Installation Script

Execute the command below to download and configure the necessary services:

    curl -L -o get.sh "https://git.rnp.br/redes-abertas/docker-composes/-/raw/main/Telegraf/get.sh?inline=false" && sh get.sh && cd Telegraf
    curl -L -o get.bat "https://git.rnp.br/redes-abertas/docker-composes/-/raw/main/Telegraf/get.bat?inline=false" && call get.bat && cd Telegraf

This command will:

  • Download the Docker Compose file containing the service configuration.
  • Create the Telegraf directory, where the necessary files will be stored.

5. Starting the Containers

To start the Telegraf services and its components, execute:

docker compose up -d

This will start the following containers:

  1. Telegraf: Data collection agent with support for various protocols and formats.

    • IP: 172.10.10.114
    • Mapped volumes:
      • Telegraf configuration.
      • Host system directories (proc, sys, etc).
    • Documentation: Telegraf Documentation
  2. InfluxDB: Database to store metrics collected by Telegraf.

    • IP: 172.10.10.112
    • Access credentials:
      • Username: admin
      • Password: admin
    • Default database: telemetry
    • Documentation: InfluxDB Documentation
  3. Grafana: Graphical interface for visualizing metrics stored in InfluxDB.

    • IP: 172.10.10.111
    • Default Port: 3000
    • Credentials:
      • Username: admin
      • Password: admin
    • Documentation: Grafana Documentation
  4. Chronograf: Additional tool for visual queries and analysis in InfluxDB.

To check the execution status of the containers:

docker compose ps

6. Accessing the Components

6.1. Grafana Access

After initializing the services, Grafana will be accessible at:

http://<SERVER_IP>:3000

Log in using the default credentials below:

  • Username: admin
  • Password: admin

6.2. Chronograf Access

Chronograf can be accessed at:

http://<SERVER_IP>:8888

Use the credentials configured in InfluxDB to access and configure queries.

8. Next Steps

  • Create custom Dashboards in Grafana: Explore the metrics to create specific visualizations for your needs.
  • Add Data Sources to Telegraf: Expand the usage by configuring Telegraf to collect metrics from other sources of interest in the laboratory.

For more information about Telegraf, see the official Telegraf documentation.