### Create User and Database to store the Data from Telegraf Agent.
influx
create database telegraf
create user telegraf with password 'myP@ssw0rd'
show databases
show users
Telegraf: Installation and the configurations
### Install Telegraf Agent
sudo apt install telegraf -y
sudo systemctl start telegraf
sudo systemctl enable telegraf
sudo systemctl status telegraf
### Configure Telegraf
In this step, we will configure the Telegraf to use basic input plugins for
collecting system metric of the server and using the influxdb as the output plugin.
cd /etc/telegraf/telegraf.d/
touch my_config_telegraf.conf
nano my_config_telegraf.conf
Login to grafana and add the InfluxDB as Data source
## Login to grafana
http://192.168.178.37:3000
Username: admin
Password: admin
##
add data source (influxDB)
urls = [ "http://127.0.0.1:8086" ]
database = "telegraf"
username = "telegraf"
password = "myP@ssw0rd"
Type = GET
Import the Dashboard
## adding the Dashboard
Now open the sample Grafana dashboard from URL
'https://grafana.com/dashboards/5955'
and click the 'Copy the ID to Clipboard' button.
Paste in Grafana to import the Telegraf - System Metrics Dashboard