diff options
author | Christian Breunig <christian@breunig.cc> | 2024-10-04 13:42:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-04 13:42:53 +0200 |
commit | a175bd6518cc27376eb179115d69ce42f0c5f69a (patch) | |
tree | 73d5b4cc53acec9a2a83e46716d8006bc2cd7e00 /data/templates | |
parent | 2a46c1cfb229f0e473b91aeaf8dfd278527ccda6 (diff) | |
parent | 1749c3a99b88c8376b505d0d776cc9b4d5f167cd (diff) | |
download | vyos-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.j2 | 20 |
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 |