mirror of
https://github.com/prometheus-community/ansible
synced 2024-11-22 11:53:12 +00:00
1173d1ada7
Signed-off-by: gardar <gardar@users.noreply.github.com>
32 lines
940 B
Django/Jinja
32 lines
940 B
Django/Jinja
[Unit]
|
|
Description=Prometheus SNMP Exporter
|
|
After=network-online.target
|
|
StartLimitInterval=0
|
|
|
|
[Service]
|
|
Type=simple
|
|
User=nobody
|
|
Group={{ 'nogroup' if ansible_os_family == 'Debian' else 'nobody' }}
|
|
ExecReload=/bin/kill -HUP $MAINPID
|
|
ExecStart={{ snmp_exporter_binary_install_dir }}/snmp_exporter \
|
|
{% if snmp_exporter_version is version('0.21.0', '>=') and
|
|
snmp_exporter_web_listen_address is iterable and
|
|
snmp_exporter_web_listen_address is not mapping and
|
|
snmp_exporter_web_listen_address is not string %}
|
|
{% for address in snmp_exporter_web_listen_address %}
|
|
--web.listen-address={{ address }} \
|
|
{% endfor %}
|
|
{% else %}
|
|
--web.listen-address={{ snmp_exporter_web_listen_address }} \
|
|
{% endif %}
|
|
--log.level={{ snmp_exporter_log_level }} \
|
|
--config.file={{ snmp_exporter_config_dir }}/snmp.yml
|
|
|
|
KillMode=process
|
|
|
|
SyslogIdentifier=snmp_exporter
|
|
Restart=always
|
|
RestartSec=1
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|