prometheus/templates/systemd/prometheus-mongodb-exporter.service.j2
2021-05-31 12:18:34 +02:00

15 lines
842 B
Django/Jinja
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[Unit]
Description=Prometheus MongoDB Exporter
After=network.target
[Service]
Type=simple
{% if (prometheus_mongodb_exporter_user is defined) and (prometheus_mongodb_exporter_pass is defined) %}
ExecStart=/usr/local/bin/prometheus-mongodb-exporter --mongodb.uri=mongodb://{{ prometheus_mongodb_exporter_user }}:{{ prometheus_mongodb_exporter_pass }}@{{ prometheus_mongodb_exporter_host|default("localhost") }}:{{ prometheus_mongodb_exporter_port|default("27017") }}/{{ prometheus_mongodb_exporter_database|default("admin") }}
{% else %}
ExecStart=/usr/local/bin/prometheus-mongodb-exporter --mongodb.uri=mongodb://{{ prometheus_mongodb_exporter_host|default("localhost") }}:{{ prometheus_mongodb_exporter_port|default("27017") }}/{{ prometheus_mongodb_exporter_database|default("admin") }}
{% endif %}
[Install]
WantedBy=multi-user.target