prometheus/templates/systemd/prometheus-mongodb-exporter.service.j2

15 lines
842 B
Plaintext
Raw Normal View History

2021-04-29 18:53:56 +02:00
[Unit]
Description=Prometheus MongoDB Exporter
After=network.target
2021-05-31 12:18:34 +02:00
2021-04-29 18:53:56 +02:00
[Service]
Type=simple
2021-05-31 12:18:34 +02:00
{% 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 %}
2021-04-29 18:53:56 +02:00
[Install]
WantedBy=multi-user.target