From 692f103fe535cd8f3ed20206a3c17cddd151e046 Mon Sep 17 00:00:00 2001 From: Viacheslav Hletenko Date: Wed, 12 Apr 2023 08:39:24 +0000 Subject: T5152: Get default hostname for telegraf from FQDN or hostname Fix for Telegraf agent hostname isn't qualified Try to get the hostname from FQDN and then from the hostname Used for metrics You may have more than one machine with different domain names r1 domain-name foo.local, hostname myhost r2 domain-name bar.local, hostname myhost It helps to detect from which exactly host we get metrics for InfluxDB2 --- data/templates/monitoring/telegraf.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'data') diff --git a/data/templates/monitoring/telegraf.tmpl b/data/templates/monitoring/telegraf.tmpl index c5cbddc8c..5b9838f7b 100644 --- a/data/templates/monitoring/telegraf.tmpl +++ b/data/templates/monitoring/telegraf.tmpl @@ -12,7 +12,7 @@ debug = false quiet = false logfile = "" - hostname = "" + hostname = "{{ hostname }}" omit_hostname = false {% if influxdb_configured is defined %} [[outputs.influxdb_v2]] -- cgit v1.2.3