summaryrefslogtreecommitdiff
path: root/data/templates
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-10-04 13:42:53 +0200
committerGitHub <noreply@github.com>2024-10-04 13:42:53 +0200
commita175bd6518cc27376eb179115d69ce42f0c5f69a (patch)
tree73d5b4cc53acec9a2a83e46716d8006bc2cd7e00 /data/templates
parent2a46c1cfb229f0e473b91aeaf8dfd278527ccda6 (diff)
parent1749c3a99b88c8376b505d0d776cc9b4d5f167cd (diff)
downloadvyos-1x-a175bd6518cc27376eb179115d69ce42f0c5f69a.tar.gz
vyos-1x-a175bd6518cc27376eb179115d69ce42f0c5f69a.zip
Merge pull request #4048 from rebortg/node_exporter
T973: add basic node_exporter implementation
Diffstat (limited to 'data/templates')
-rw-r--r--data/templates/node_exporter/node_exporter.service.j220
1 files changed, 20 insertions, 0 deletions
diff --git a/data/templates/node_exporter/node_exporter.service.j2 b/data/templates/node_exporter/node_exporter.service.j2
new file mode 100644
index 000000000..62e7e6774
--- /dev/null
+++ b/data/templates/node_exporter/node_exporter.service.j2
@@ -0,0 +1,20 @@
+{% set vrf_command = 'ip vrf exec ' ~ vrf ~ ' runuser -u node_exporter -- ' if vrf is vyos_defined else '' %}
+[Unit]
+Description=Node Exporter
+Documentation=https://github.com/prometheus/node_exporter
+After=network.target
+
+[Service]
+{% if vrf is not vyos_defined %}
+User=node_exporter
+{% endif %}
+ExecStart={{ vrf_command }}/usr/sbin/node_exporter \
+{% if listen_address is vyos_defined %}
+{% for address in listen_address %}
+ --web.listen-address={{ address }}:{{ port }}
+{% endfor %}
+{% else %}
+ --web.listen-address=:{{ port }}
+{% endif %}
+[Install]
+WantedBy=multi-user.target