From 2a38b57a2a7382896e4eca9957c6c0fd35885ae4 Mon Sep 17 00:00:00 2001 From: Tobias Florek Date: Wed, 19 Apr 2017 18:54:15 +0200 Subject: [PATCH] Mention copr yum repository, add systemd unit (#529) * add systemd unit as example * mention community yum repo fixes #498 * rename textfile collector dir --- README.md | 4 ++++ examples/systemd/README.md | 8 ++++++++ examples/systemd/node_exporter.service | 10 ++++++++++ examples/systemd/sysconfig.node_exporter | 1 + 4 files changed, 23 insertions(+) create mode 100644 examples/systemd/README.md create mode 100644 examples/systemd/node_exporter.service create mode 100644 examples/systemd/sysconfig.node_exporter diff --git a/README.md b/README.md index 645925f5..94a1a65f 100644 --- a/README.md +++ b/README.md @@ -138,6 +138,10 @@ docker run -d -p 9100:9100 \ Be aware though that the mountpoint label in various metrics will now have `/host` as prefix. +## Using a third-party repository for RHEL/CentOS/Fedora + +There is a [community-supplied COPR repository](https://copr.fedorainfracloud.org/coprs/ibotty/prometheus-exporters/). It closely follows upstream releases. + [travis]: https://travis-ci.org/prometheus/node_exporter [hub]: https://hub.docker.com/r/prom/node-exporter/ [circleci]: https://circleci.com/gh/prometheus/node_exporter diff --git a/examples/systemd/README.md b/examples/systemd/README.md new file mode 100644 index 00000000..c1f011fb --- /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 00000000..64f1405b --- /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 00000000..7afdb91b --- /dev/null +++ b/examples/systemd/sysconfig.node_exporter @@ -0,0 +1 @@ +OPTIONS="-collector.textfile.directory /var/lib/node_exporter/textfile_collector"