From 2a38b57a2a7382896e4eca9957c6c0fd35885ae4 Mon Sep 17 00:00:00 2001 From: Tobias Florek Date: Wed, 19 Apr 2017 18:54:15 +0200 Subject: Mention copr yum repository, add systemd unit (#529) * add systemd unit as example * mention community yum repo fixes #498 * rename textfile collector dir --- examples/systemd/README.md | 8 ++++++++ examples/systemd/node_exporter.service | 10 ++++++++++ examples/systemd/sysconfig.node_exporter | 1 + 3 files changed, 19 insertions(+) create mode 100644 examples/systemd/README.md create mode 100644 examples/systemd/node_exporter.service create mode 100644 examples/systemd/sysconfig.node_exporter (limited to 'examples') diff --git a/examples/systemd/README.md b/examples/systemd/README.md new file mode 100644 index 0000000..c1f011f --- /dev/null +++ b/examples/systemd/README.md @@ -0,0 +1,8 @@ +# Systemd Unit + +If you are using distribution packages or the copr repository, you don't need to deal with these files! + +The unit file in this directory is to be put into `/etc/systemd/system`. +It needs a user named `node_exporter`, whose shell should be `/sbin/nologin` and should not have any special privileges. +It needs a sysconfig file in `/etc/sysconfig/node_exporter`. +A sample file can be found in `sysconfig.node_exporter`. diff --git a/examples/systemd/node_exporter.service b/examples/systemd/node_exporter.service new file mode 100644 index 0000000..64f1405 --- /dev/null +++ b/examples/systemd/node_exporter.service @@ -0,0 +1,10 @@ +[Unit] +Description=Node Exporter + +[Service] +User=node_exporter +EnvironmentFile=/etc/sysconfig/node_exporter +ExecStart=/usr/sbin/node_exporter $OPTIONS + +[Install] +WantedBy=multi-user.target diff --git a/examples/systemd/sysconfig.node_exporter b/examples/systemd/sysconfig.node_exporter new file mode 100644 index 0000000..7afdb91 --- /dev/null +++ b/examples/systemd/sysconfig.node_exporter @@ -0,0 +1 @@ +OPTIONS="-collector.textfile.directory /var/lib/node_exporter/textfile_collector" -- cgit v1.2.3