mirror of
https://github.com/prometheus-community/ansible
synced 2024-11-26 05:40:18 +00:00
54d857d41b
Signed-off-by: Christian Krause <christian.krause@idiv.de>
32 lines
904 B
Django/Jinja
32 lines
904 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=/usr/local/bin/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=/etc/snmp_exporter/snmp.yml
|
|
|
|
KillMode=process
|
|
|
|
SyslogIdentifier=snmp_exporter
|
|
Restart=always
|
|
RestartSec=1
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|