summaryrefslogtreecommitdiff
path: root/data/templates/node_exporter
diff options
context:
space:
mode:
Diffstat (limited to 'data/templates/node_exporter')
-rw-r--r--data/templates/node_exporter/node_exporter.service.j217
1 files changed, 17 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..01dad5aa2
--- /dev/null
+++ b/data/templates/node_exporter/node_exporter.service.j2
@@ -0,0 +1,17 @@
+{% 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 \
+{% for address in listen_address %}
+ --web.listen-address={{ address }}:{{ port }}
+{% endfor %}
+
+[Install]
+WantedBy=multi-user.target