From f3e6fb5aab6f562dab49f559f31c58c0f86c03df Mon Sep 17 00:00:00 2001
From: KyleM <103862795+ServerForge@users.noreply.github.com>
Date: Thu, 22 Sep 2022 01:57:29 -0400
Subject: telegraf: T4680: fix prometheus client listen-address invalid format
---
data/templates/telegraf/telegraf.j2 | 2 +-
.../include/listen-address-single.xml.i | 22 ++++++++++++++++++++++
.../service-monitoring-telegraf.xml.in | 2 +-
3 files changed, 24 insertions(+), 2 deletions(-)
create mode 100644 interface-definitions/include/listen-address-single.xml.i
diff --git a/data/templates/telegraf/telegraf.j2 b/data/templates/telegraf/telegraf.j2
index 6b395692b..2d14230ae 100644
--- a/data/templates/telegraf/telegraf.j2
+++ b/data/templates/telegraf/telegraf.j2
@@ -45,7 +45,7 @@
### Prometheus ###
[[outputs.prometheus_client]]
## Address to listen on
- listen = "{{ prometheus_client.listen_address if prometheus_client.listen_address is vyos_defined else '' }}:{{ prometheus_client.port }}"
+ listen = "{{ prometheus_client.listen_address | bracketize_ipv6 if prometheus_client.listen_address is vyos_defined else '' }}:{{ prometheus_client.port }}"
metric_version = {{ prometheus_client.metric_version }}
{% if prometheus_client.authentication.username is vyos_defined and prometheus_client.authentication.password is vyos_defined %}
## Use HTTP Basic Authentication
diff --git a/interface-definitions/include/listen-address-single.xml.i b/interface-definitions/include/listen-address-single.xml.i
new file mode 100644
index 000000000..b5841cabb
--- /dev/null
+++ b/interface-definitions/include/listen-address-single.xml.i
@@ -0,0 +1,22 @@
+
+
+ Local IP addresses to listen on
+
+
+
+
+ ipv4
+ IPv4 address to listen for incoming connections
+
+
+ ipv6
+ IPv6 address to listen for incoming connections
+
+
+
+
+
+
+
+
+
diff --git a/interface-definitions/service-monitoring-telegraf.xml.in b/interface-definitions/service-monitoring-telegraf.xml.in
index 68215dba4..47f943d83 100644
--- a/interface-definitions/service-monitoring-telegraf.xml.in
+++ b/interface-definitions/service-monitoring-telegraf.xml.in
@@ -228,7 +228,7 @@
- #include
+ #include
Metric version control mapping from Telegraf to Prometheus format
--
cgit v1.2.3