From a0c15a159e54cb1b6abba7a0a6a0a793a53915d0 Mon Sep 17 00:00:00 2001 From: rebortg Date: Wed, 11 Sep 2024 14:15:07 +0200 Subject: T973: add basic node_exporter implementation --- data/templates/node_exporter/node_exporter.service.j2 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 data/templates/node_exporter/node_exporter.service.j2 (limited to 'data') 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 -- cgit v1.2.3