@@ -9,17 +9,21 @@ Type=simple
9
9
User={{ _systemd_exporter_system_user }}
10
10
Group={{ _systemd_exporter_system_group }}
11
11
ExecStart={{ _systemd_exporter_binary_install_dir }}/systemd_exporter \
12
- {% for collector in systemd_exporter_enabled_collectors -%}
13
- {% if not collector is mapping %}
14
- --collector.{{ collector }} \
15
- {% else -%}
16
- {% set name , options = (collector .items ()|list )[0] -%}
17
- --collector.{{ name }} \
18
- {% for k ,v in options |dictsort %}
19
- --collector.{{ name }}.{{ k }}={{ v | quote }} \
20
- {% endfor -%}
21
- {% endif -%}
22
- {% endfor -%}
12
+ {% if systemd_exporter_enable_restart_count %}
13
+ --collector.enable-restart-count \
14
+ {% endif %}
15
+ {% if systemd_exporter_enable_file_descriptor_size %}
16
+ --collector.enable-file-descriptor-size \
17
+ {% endif %}
18
+ {% if systemd_exporter_enable_ip_accounting %}
19
+ --collector.enable-ip-accounting \
20
+ {% endif %}
21
+ {% if systemd_exporter_unit_allowlist != "" %}
22
+ --collector.unit-whitelist={{ systemd_exporter_unit_allowlist }} \
23
+ {% endif %}
24
+ {% if systemd_exporter_unit_denylist != "" %}
25
+ --collector.unit-blacklist={{ systemd_exporter_unit_denylist }} \
26
+ {% endif %}
23
27
--web.listen-address={{ systemd_exporter_web_listen_address }}
24
28
25
29
SyslogIdentifier=systemd_exporter
@@ -30,7 +34,7 @@ StartLimitInterval=0
30
34
ProtectHome=yes
31
35
NoNewPrivileges=yes
32
36
33
- {% if systemd_exporter_systemd_version | int >= 232 %}
37
+ {% if _systemd_exporter_systemd_version | int >= 232 %}
34
38
ProtectSystem=strict
35
39
ProtectControlGroups=true
36
40
ProtectKernelModules=true
0 commit comments