📒
Urduheim
  • Welcome to Urduheim Docs
  • Windows Terminal 2020
  • Ubuntu Tutorials
    • How to monitor Multiple Servers with Grafana on a Single Dashboard
    • How to install Grafana, InfluxDB and Telegraf on Ubuntu 20.04 LTS
    • Central Syslog Server Configurations
    • FreeRadius
  • How to install Open media vault on Raspberry pi 4B
Powered by GitBook
On this page
  1. Ubuntu Tutorials

How to monitor Multiple Servers with Grafana on a Single Dashboard

Add multiple Servers to Grafana Single Dashboard

PreviousWindows Terminal 2020NextHow to install Grafana, InfluxDB and Telegraf on Ubuntu 20.04 LTS

Last updated 4 years ago

To monitor many servers from a Single Grafana Dashboard, we need to install the Telegraf Agent on each Server

We have already created the Database, User & Password on InfluxDB, if you did not watch that Video Check that out first.

### Installing required packages
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 Telegraf Agent on each Server

### Install Telegraf Agent
sudo apt install telegraf -y

sudo systemctl start telegraf
sudo systemctl enable telegraf

##Check Status
sudo systemctl status telegraf
##Enable Network Inputs in Telegraf.conf by uncommenting, by default disabled

cd /etc/telegraf/telegraf.conf

[[inputs.net]]
interfaces = ["eth0"]

[[inputs.netstat]]
##Create Custom Telegraf File to send Metrics towards influxDB
cd /etc/telegraf/telegraf.d/

touch my_config_telegraf.conf
nano my_config_telegraf.conf

Config File: 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://influxdb-ip:8086" ]
  username = "telegraf"
  password = "myP@ssw0rd"
  
#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

https://youtu.be/UQWOWtioopw