Use correct --collector flags for older versions

Signed-off-by: Håvard Pettersson <haavard.pettersson@gmail.com>
This commit is contained in:
Håvard Pettersson 2023-08-26 08:29:12 +00:00
parent 0485844c3e
commit c6294f348c

View file

@ -10,13 +10,25 @@ User={{ systemd_exporter_system_user }}
Group={{ systemd_exporter_system_group }}
ExecStart={{ systemd_exporter_binary_install_dir }}/systemd_exporter \
{% if systemd_exporter_enable_restart_count %}
{% if systemd_exporter_version is version('0.5.0', '>=') %}
--systemd.collector.enable-restart-count \
{% else %}
--collector.enable-restart-count \
{% endif %}
{% endif %}
{% if systemd_exporter_enable_file_descriptor_size %}
{% if systemd_exporter_version is version('0.5.0', '>=') %}
--systemd.collector.enable-file-descriptor-size \
{% else %}
--collector.enable-file-descriptor-size \
{% endif %}
{% endif %}
{% if systemd_exporter_enable_ip_accounting %}
{% if systemd_exporter_version is version('0.5.0', '>=') %}
--systemd.collector.enable-ip-accounting \
{% else %}
--collector.enable-ip-accounting \
{% endif %}
{% endif %}
{% if systemd_exporter_unit_include != ""%}
--systemd.collector.unit-include={{ systemd_exporter_unit_include }} \