Nov 8, 2022

Lab Guide: Grafana Dashboard

Let us understand the component in monitoring stacks, often used in combination with time series databases.
Nandani Sah
Nandani SahSoftware Engineer In Platforms - I
lines

How to Monitor Multiple Servers with Grafana on a Single Dashboard?

To monitor many servers from a Single Grafana Dashboard, we need to install the Agent on each Server that we need to monitor and the database in a server which is required to store live data.

We will be using:

  • InfluxDb [ Database ]
  • Telegraf [ Monitoring agent ]
  • Grafana [ Graphical representation of the server metrics ]

InfluxDB

InfluxDB is purpose-built for time series data. Relational databases can handle time series data, but are not optimized for common time series workloads. InfluxDB is designed to store large volumes of time series data and quickly perform real-time analysis on that data. Grafana is a visualization tool for time series data.

Telegraf

Telegraf is a server-based agent for collecting all kinds of metrics for further processing. It's a piece of software that you can install anywhere in your infrastructure and it will read metrics from specified sources application logs, events, or data outputs.

Grafana Dashboard

A Grafana dashboard is a powerful open source analytical and visualization tool that consists of multiple individual panels arranged in a grid. The panels interact with configured data sources, including (but not limited to) AWS CloudWatch, Microsoft SQL server, Prometheus, MySQL, InfluxDB, and many others.

Steps to Set Up Dashboard

For this, we are using two servers:

  • In server01 we shall be installing Grafana, InfluxDb, and Telegraf.
  • In server02 we shall be installing Telegraf.

Under server01

  • Add and Install the InfluxDB, required packages, and Telegraf Repositories.

  • Install the following prerequisites packages to all the server.

Install Infuxdb

Create User and Database to store the Data from Telegraf Agent.

Install in all the server you need to monitor `Telegraf Agent: Installation and the configurations.`

Change hostname.

Configure Telegraf.

In this step, we will configure the Telegraf to use basic input plugins for collecting system metrics of the server, and using the influxdb as the output plugin.

Manage Configuration

Telegraf provides telegraf command to manage the configuration, including generate the configuration itself, run the command as below.

Install Grafana-Dashboard

Login to Grafana and go to dashboard.

Add the InfluxDB as Data Source.

Under Server02 - Ubuntu.

Lab Guide: Grafana - Server 2 - Ubuntu

Follow the above command to add monitoring agent and configure to monitor server02.

This shall land you with the desired results. Hope you had a good read!

Hire our Development experts.