summaryrefslogtreecommitdiff
path: root/data/templates/frr_exporter/frr_exporter.service.j2
diff options
context:
space:
mode:
authorNataliia S. <81954790+natali-rs1985@users.noreply.github.com>2024-10-21 10:30:38 +0300
committerGitHub <noreply@github.com>2024-10-21 10:30:38 +0300
commit18a9cec3deb6cc2dc49020a89208dc70defe9822 (patch)
treebe0bcfa93d52d559da03bc97eb928fc508bacd7d /data/templates/frr_exporter/frr_exporter.service.j2
parent5c76607a9faef1fb5dc07459a38d37261ce988c1 (diff)
parentfa272f5297177354714ee7867104f43e4e322df6 (diff)
downloadvyos-1x-18a9cec3deb6cc2dc49020a89208dc70defe9822.tar.gz
vyos-1x-18a9cec3deb6cc2dc49020a89208dc70defe9822.zip
Merge branch 'current' into T6695
Diffstat (limited to 'data/templates/frr_exporter/frr_exporter.service.j2')
-rw-r--r--data/templates/frr_exporter/frr_exporter.service.j220
1 files changed, 20 insertions, 0 deletions
diff --git a/data/templates/frr_exporter/frr_exporter.service.j2 b/data/templates/frr_exporter/frr_exporter.service.j2
new file mode 100644
index 000000000..c3892e42b
--- /dev/null
+++ b/data/templates/frr_exporter/frr_exporter.service.j2
@@ -0,0 +1,20 @@
+{% set vrf_command = 'ip vrf exec ' ~ vrf ~ ' runuser -u frr -- ' if vrf is vyos_defined else '' %}
+[Unit]
+Description=FRR Exporter
+Documentation=https://github.com/tynany/frr_exporter
+After=network.target
+
+[Service]
+{% if vrf is not vyos_defined %}
+User=frr
+{% endif %}
+ExecStart={{ vrf_command }}/usr/sbin/frr_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