blob: 50e81c5f1977e1df9f2a8d8188a6444bcabd3de2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
{% set icmp_enabled = modules is vyos_defined and modules.icmp is vyos_defined and modules.icmp.name is vyos_defined %}
{% if vrf is vyos_defined %}
{% if icmp_enabled %}
{# j2lint: disable=operator-enclosed-by-spaces #}
{% set vrf_command = 'ip vrf exec ' ~ vrf ~ ' setpriv --reuid=node_exporter --regid=node_exporter --init-groups --inh-caps=+net_raw --ambient-caps=+net_raw -- ' %}
{% else %}
{% set vrf_command = 'ip vrf exec ' ~ vrf ~ ' runuser -u node_exporter -- ' %}
{% endif %}
{% else %}
{% set vrf_command = '' %}
{% endif %}
[Unit]
Description=Blackbox Exporter
Documentation=https://github.com/prometheus/blackbox_exporter
After=network.target
[Service]
{% if vrf is not vyos_defined %}
User=node_exporter
{% endif %}
{% if vrf is not vyos_defined and icmp_enabled %}
AmbientCapabilities=CAP_NET_RAW
CapabilityBoundingSet=CAP_NET_RAW
{% endif %}
ExecStart={{ vrf_command }}/usr/sbin/blackbox_exporter \
{% if listen_address is vyos_defined %}
{% for address in listen_address %}
--web.listen-address={{ address | bracketize_ipv6 }}:{{ port }} \
{% endfor %}
{% else %}
--web.listen-address=:{{ port }} \
{% endif %}
--config.file=/run/blackbox_exporter/config.yml
[Install]
WantedBy=multi-user.target
|