This Docker setup deploys a fully integrated stack of InfluxDB, Telegraf, and Grafana, connecting all services with a single token. It includes two sample dashboards as examples. In essence, this is a ready-to-use system for collecting data from any sensors or any data sources.
If you need specific security settings, rename the .env.example
file to .env
and fill it out.
-
To initialize the InfluxDB database, run the following command once:
docker compose up influxdb_cli
After initialization (wait 10–15 seconds), press
Ctrl + C
. -
Start all services:
docker compose up -d
-
Stop all services:
docker compose down
docker compose up -f docker-compose-only-grafana.yml -d
telegraf/telegraf-conf/
– Telegraf configuration filestelegraf.conf
– contains the configured output to InfluxDB.telegraf.d/
– folder with input configurations for various data sources.
telegraf/mibs/
– MIB files for polling SNMP devices (replaces/usr/share/snmp/mibs
).
-
Grafana: http://localhost:3000
Login/Password: admin / admingrafana -
InfluxDB: http://localhost:8086
Login/Password: admin / admininflux
Tokens and passwords are fixed – this setup is for learning and getting familiar with the technologies.
Recommended:
- Generate a new token in the InfluxDB interface.
- Insert this token into the
telegraf.conf
configuration file. - Add a new data source in Grafana using this token.
- Finally, change the passwords for the InfluxDB and Grafana web interfaces to secure and unique ones.
- Grafana: Configured via environment variables in
docker-compose.yml
. - InfluxDB: Data is stored in the
influxdb2
directory and configured via environment variables indocker-compose.yml
. - Telegraf: Configurations are specified in
telegraf/telegraf.conf
.
- Network: lab240-monitoring
- Volumes:
- grafana-data: Grafana data
- ./influxdb2: InfluxDB data