summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2023-04-12 08:39:24 +0000
committerViacheslav Hletenko <v.gletenko@vyos.io>2023-04-12 08:39:24 +0000
commit692f103fe535cd8f3ed20206a3c17cddd151e046 (patch)
treea02f53412f7ab326867c637a39c9f4044ad2a6c2 /data
parent0b0f991a86461ed725762010cf263fb2f0eaa16a (diff)
downloadvyos-1x-692f103fe535cd8f3ed20206a3c17cddd151e046.tar.gz
vyos-1x-692f103fe535cd8f3ed20206a3c17cddd151e046.zip
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
Diffstat (limited to 'data')
-rw-r--r--data/templates/monitoring/telegraf.tmpl2
1 files changed, 1 insertions, 1 deletions
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]]