Nov 7, 2022

Lab Guide: Grafana Dashboard

Let us understand the component in monitoring stacks, often used in combination with time series databases.

Author

Nandani SahSenior DevOps Engineer - I
Lab Guide: Grafana Dashboard

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.
apt install curl gnupg gnupg1 gnupg2 net-tools software-properties-common

sudo curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
source /etc/lsb-release echo "deb https://repos.influxdata.com/${DISTRIB_ID,} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
sudo apt update

Install Infuxdb

sudo apt install influxdb -y #installing  the influxdb
sudo systemctl start influxdb # start influxdb 
sudo systemctl enable influxdb  # Enable the influxdb
netstat -nlp # Check the port running on the machine

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

influx

create database telegraf #create the database named 
create user telegraf with password 'Password@1' # create the user 

show databases #checking the telegraf database is present or not
show users #checking the telegraf user is created is present or not

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

sudo apt install telegraf -y #Installing the telegraf agent to monitor the machine using the grafanba dashboard.
sudo systemctl start telegraf # start telegraf
sudo systemctl enable telegraf  #Enable the telegraf 
sudo systemctl status telegraf #check the status of telegraf

Change hostname.

vim /etc/hosts #edit the host of the machine
Ip-address Garfana
:wq!  #save and quit 
vim /etc/hostname  #edit the hostname of the machine
Garfana
hostname Garfana

hostname -f #check the hostname of the machine is updated

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.

vim  /etc/telegraf/telegraf.d/my_config_telegraf.conf

# Global Agent Configuration
[agent]
  hostname = **"Grafana"**
  flush_interval = "10s"
  interval = "10s"


# Input Plugins
[[inputs.cpu]]
    percpu = true
    totalcpu = true
    collect_cpu_time = false
    report_active = false
[[inputs.disk]]
    ignore_fs = ["tmpfs", "devtmpfs", "devfs"]
[[inputs.io]]
[[inputs.mem]]
[[inputs.net]]
[[inputs.system]]
[[inputs.swap]]
[[inputs.netstat]]
[[inputs.processes]]
[[inputs.kernel]]

# Output Plugin InfluxDB
[[outputs.influxdb]]
  database = **"telegraf"**
  urls = **[ "http://127.0.0.1:8086" ]**
  username = **"telegraf"**
  password =** "Password@1"**

Manage Configuration

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

#Generate configurations
telegraf config -input-filter cpu:mem:disk:swap:system:net:netstat -output-filter influxdb > my_config_telegraf.conf

Install Grafana-Dashboard

wget -q -O - https://packages.grafana.com/gpg.key | apt-key add -  #download grafana 

add-apt-repository "deb https://packages.grafana.com/oss/deb stable main" #add the above dowloaded packages in repository

apt-get update -y  # update the machine
apt-get install grafana -y #installing the grafana
systemctl daemon-reload  
systemctl enable --now grafana-server  #enable the grafana server
systemctl start grafana-server #start the grafana server
systemctl status grafana-server # check the status of grafana-server

Login to Grafana and go to dashboard.

http://ip:3000 #go to browser
Username: admin #default username
Password: admin #default password

Add the InfluxDB as Data Source.

# Go to browser for Dashboard Now open the sample Grafana dashboard from below URL

  urls = [ "http://127.0.0.1:8086" ]
  database = "telegraf"
  username = "telegraf"
  password = "Password@1"
  Type = GET

Under Server02 - Ubuntu.

vim /etc/hosts
ip -address ubuntu

vim /etc/hostname
ubuntu

hostname 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!

Subscribe to Our Newsletter

RELATED ARTICLES

More from the engineering frontline.

Dive deep into our research and insights on design, development, and the impact of various trends to businesses.
Why Legacy Systems Block Real-Time AI Decision-Making
Business

Aug 4, 2026

Why Legacy Systems Block Real-Time AI Decision-Making
Learn how legacy systems limit real-time AI decision-making and what businesses can do to build an AI-ready infrastructure.
What Makes an AI Product Enterprise-Ready? A Business Leader’s Perspective
Business

Aug 4, 2026

What Makes an AI Product Enterprise-Ready? A Business Leader’s Perspective
Most AI pilots never make it to production. Here are the five questions business leaders should ask before approving, buying, or scaling an AI product.
Building AI-Powered Banking CRM Platforms Without Replacing Core Banking Systems
Business

Jul 31, 2026

Building AI-Powered Banking CRM Platforms Without Replacing Core Banking Systems
Banks can modernize CRM with AI without replacing their core banking systems. This guide covers the architecture, use cases, governance, and roadmap to do it.
AI in Fintech: Everyone's Talking, Few are Shipping
Business

Jul 30, 2026

AI in Fintech: Everyone's Talking, Few are Shipping
This blog covers the key engineering, governance, and compliance principles required to build production-ready AI systems for financial services.
ERP and MES Integration for U.S. Pharma Manufacturers: A Roadmap to Achieve Zero-Error Production and End-to-End Traceability
Business

Jul 27, 2026

ERP and MES Integration for U.S. Pharma Manufacturers: A Roadmap to Achieve Zero-Error Production and End-to-End Traceability
A strategic roadmap for U.S. pharma leaders integrating ERP and MES to reduce production errors, accelerate batch release, strengthen compliance readiness, and enable end-to-end traceability across manufacturing sites.
How to Build Medical Device Software with AI: Compliance, Architecture, and Development Process
Business

Jul 24, 2026

How to Build Medical Device Software with AI: Compliance, Architecture, and Development Process
A guide for engineering leaders on building compliant, production-ready AI medical device software, from architecture to FDA clearance.

The Right Conversation Can Save You Six Months.

Whether you’re navigating AI adoption, modernizing legacy systems, or scaling a product - we start by listening. No pitch deck. No template. A real conversation.