Telegraf InfluxDb Grafana
What is it Telegraf, InfluxDB & Grafana?
Telegraf
Telegraf Is a tool that allows you to monitor a server.
It gets information about disk, memory, cpu, etc.
InfluxDb
Influxdb is a timebase database for storing information.
In this case is used to store the metrics of a sytsem.
Grafana
Grafana is a tool to visualizae data. It allows multiple data sources. Influxdb is one of them.
Instaling the software
This is an instalation in Unbutu.
Instaling Telegraf
wget -q -O - https://repos.influxdata.com/influxdb.key | sudo apt-key add -
sudo add-apt-repository "deb https://repos.influxdata.com/ubuntu bionic stable"
sudo apt-get update
sudo apt-get install telegraf
Instaling InfluxDb
sudo apt-get install influxdb
sudo apt-get install influxdb-client
Instaling Grafana
wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
wget -q -O - https://repos.influxdata.com/influxdb.key | sudo apt-key add -
sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"
sudo apt-get update
sudo apt-get install grafana
Lauching services
To lauch or know the status of a service you shout use the omand service
>sudo service
Usage: service < option > | --status-all | [ service_name [ command | --full-restart ] ]
sudo service influxdb start
sudo service grafana-server start
sudo service telegraf start
Creating influxdb database
Telegraf expects that a database with the name telegraf (you can change that) exists in influxdb You need to lauch the comand for influxdb.
influx
create database telegraf
Using Grafana
Launching grafana
http://127.0.0.1:3000/
Create a datasource
Fill in:
Name: Name of the DataSource
Influxdb Telegraf
URL: Server where InfluxDB is
http://127.0.0.1:8086
Database: InfluxDb Database name
Telegraf
User / Password:
admin
admin
Press: Save & Test
Create a dashboard
Choose option to create a new dashboards
Add a new query
Configure Query
And it is done!