Last active
September 18, 2018 08:24
-
-
Save amorken/9357b25b88a13354e7ce01c30e4fada6 to your computer and use it in GitHub Desktop.
Example Systemd configuration that starts the Prometheus node exporter and handles Consul registration.
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=Prometheus Node Exporter | |
After=consul-client.target consul-server.target network.target | |
[Service] | |
User=prometheus | |
ExecStart=/usr/bin/node_exporter --web.listen-address :9109 | |
ExecStartPost=/usr/local/bin/consul-cli service-register prometheus-nodeexporter --id=prometheus-nodeexporter --address=%H --port=9109 | |
ExecStop=/usr/local/bin/consul-cli service-deregister prometheus-nodeexporter | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment