Note this configuration is specifically for InfluxDBv2
Simple telegraf container that bundles a configuration with environment variables set. This should make for an easy deployment using docker. The goal is to prevent hardcoded tokens in the telegraf configuration.
# InfluxDB URL
INFLUX_URL=http://metrics.domain.com
# InfluxDB Token
INFLUX_TOKEN=Dhf7sxBY...
# InfluxDB Organization to send data to.
INFLUX_ORG=default
# InfluxDB bucket to send data to.
INFLUX_BUCKET=telegraf
Example on how to run the telegraf container with docker collecting data from the host machine.
docker run -d -v /sys:/rootfs/sys \
-v /proc:/rootfs/proc \
-v /var/run/docker.sock:/var/run/docker.sock \
-e HOST_PROC=/rootfs/proc \
-e HOST_SYS=/rootfs/sys \
-e INFLUX_URL=http://metrics.domain.com \
-e INFLUX_TOKEN=my_special_token \
-e INFLUX_ORG=default \
-e INFLUX_BUCKET=telegraf \
--name telegraf \
toilops/telegraf
Content type
Image
Digest
Size
124.2 MB
Last updated
over 4 years ago
docker pull toilops/telegraf