To monitor many servers from a Single Grafana Dashboard, we need to install the Telegraf Agent on each Server
Copy ### 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
Copy ### Install Telegraf Agent
sudo apt install telegraf -y
sudo systemctl start telegraf
sudo systemctl enable telegraf
##Check Status
sudo systemctl status telegraf
Copy ##Enable Network Inputs in Telegraf.conf by uncommenting, by default disabled
cd /etc/telegraf/telegraf.conf
[[inputs.net]]
interfaces = ["eth0"]
[[inputs.netstat]]
Copy ##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
Copy # 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.
Copy telegraf config -input-filter cpu:mem:disk:swap:system:net:netstat -output-filter influxdb > my_config_telegraf.conf