diff --git a/telegraf/docker-compose.yaml b/telegraf/docker-compose.yaml index 91950d4..1d0ba59 100644 --- a/telegraf/docker-compose.yaml +++ b/telegraf/docker-compose.yaml @@ -30,6 +30,8 @@ services: - "docker.group=telegraf" dns: - ${LOCAL_DNS_SERVER} + environment: + - "HOST_NAME=${HOST_NAME}" networks: dockersocket: diff --git a/telegraf/telegraf_net.conf b/telegraf/telegraf_net.conf index c95263f..25a8e84 100644 --- a/telegraf/telegraf_net.conf +++ b/telegraf/telegraf_net.conf @@ -62,7 +62,7 @@ precision = "" ## Override default hostname, if empty use os.Hostname() - hostname = "" + hostname = "${HOST_NAME}" ## If set to true, do no set the "host" tag in the telegraf agent. omit_hostname = false