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

{% hint style="info" %}
We have already created the Database, User & Password on InfluxDB, if you did not watch that Video Check that out first. <https://youtu.be/UQWOWtioopw>
{% endhint %}

```
### 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
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.urduheim.de/ubuntu-tutorials/how-to-monitor-multiple-servers-with-grafana-on-a-single-dashboard.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
