Created
May 21, 2018 19:50
-
-
Save jceloria/84afa9304a1368cdd509f23f595a01fb to your computer and use it in GitHub Desktop.
telegraf in Docker container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=telegraf in Docker container | |
After=docker.service container-influxdb.service | |
Requires=docker.service | |
[Service] | |
TimeoutStartSec=0 | |
Restart=always | |
ExecStartPre=-/usr/bin/docker stop telegraf | |
ExecStartPre=-/usr/bin/docker rm telegraf | |
ExecStartPre=-/usr/bin/docker pull docker.io/telegraf:alpine | |
ExecStart=/usr/bin/docker run --rm -t \ | |
-v /opt/data/telegraf/config:/etc/telegraf \ | |
-v /opt/data/telegraf/scripts:/scripts \ | |
--net=container:influxdb \ | |
--name telegraf docker.io/telegraf:alpine | |
ExecStop=-/usr/bin/docker stop -t 3 telegraf | |
ExecStop=-/usr/bin/docker rm telegraf | |
Restart=always | |
RestartSec=10s | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment