2018-12-21 11:59:20 +01:00
|
|
|
[Unit]
|
|
|
|
Description=Prometheus monitoring
|
|
|
|
After=docker.service
|
|
|
|
Requires=docker.service
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
TimeoutStartSec=0
|
|
|
|
Restart=always
|
|
|
|
ExecStartPre=-/usr/bin/docker kill %n
|
|
|
|
ExecStartPre=-/usr/bin/docker rm %n
|
|
|
|
ExecStart=/usr/bin/docker run --name %n \
|
|
|
|
--network host \
|
|
|
|
-v /srv/prometheus/prometheus:/prometheus \
|
2018-12-21 12:51:01 +01:00
|
|
|
-v /srv/prometheus/etc/nsswitch.conf/etc/nsswitch.conf \
|
2018-12-21 11:59:20 +01:00
|
|
|
-v /srv/prometheus/etc/prometheus:/etc/prometheus \
|
|
|
|
prom/prometheus:v2.6.0 \
|
|
|
|
--storage.tsdb.retention 365d --config.file=/etc/prometheus/prometheus.yml \
|
|
|
|
--storage.tsdb.path=/prometheus --web.enable-lifecycle
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|