You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you are new to Prometheus and `node_exporter` there is a [simple step-by-step guide](https://prometheus.io/docs/guides/node-exporter/).
20
+
21
+
### Ansible
22
+
23
+
For automated installs with [Ansible](https://www.ansible.com/), there is the [Cloud Alchemy role](https://github.com/cloudalchemy/ansible-node-exporter).
24
+
25
+
### RHEL/CentOS/Fedora
26
+
27
+
There is a [community-supplied COPR repository](https://copr.fedorainfracloud.org/coprs/ibotty/prometheus-exporters/) which closely follows upstream releases.
28
+
29
+
### Docker
30
+
31
+
The `node_exporter` is designed to monitor the host system. It's not recommended
32
+
to deploy it as a Docker container because it requires access to the host system.
33
+
34
+
For situations where Docker deployment is needed, some extra flags must be used to allow
35
+
the `node_exporter` access to the host namespaces.
36
+
37
+
Be aware that any non-root mount points you want to monitor will need to be bind-mounted
38
+
into the container.
39
+
40
+
If you start container for host monitoring, specify `path.rootfs` argument.
41
+
This argument must match path in bind-mount of host root. The node\_exporter will use
42
+
`path.rootfs` as prefix to access host filesystem.
43
+
44
+
```bash
45
+
docker run -d \
46
+
--net="host" \
47
+
--pid="host" \
48
+
-v "/:/host:ro,rslave" \
49
+
quay.io/prometheus/node-exporter:latest \
50
+
--path.rootfs=/host
51
+
```
52
+
53
+
For Docker compose, similar flag changes are needed.
54
+
55
+
```yaml
56
+
---
57
+
version: '3.8'
58
+
59
+
services:
60
+
node_exporter:
61
+
image: quay.io/prometheus/node-exporter:latest
62
+
container_name: node_exporter
63
+
command:
64
+
- '--path.rootfs=/host'
65
+
network_mode: host
66
+
pid: host
67
+
restart: unless-stopped
68
+
volumes:
69
+
- '/:/host:ro,rslave'
70
+
```
71
+
72
+
On some systems, the `timex` collector requires an additional Docker flag,
73
+
`--cap-add=SYS_TIME`, in order to access the required syscalls.
74
+
17
75
## Collectors
18
76
19
77
There is varying support for collectors on each operating system. The tables
@@ -181,7 +239,7 @@ For advanced use the `node_exporter` can be passed an optional list of collector
181
239
182
240
This can be useful for having different Prometheus servers collect specific metrics from nodes.
183
241
184
-
## Building and running
242
+
## Development building and running
185
243
186
244
Prerequisites:
187
245
@@ -190,8 +248,8 @@ Prerequisites:
190
248
191
249
Building:
192
250
193
-
go get github.com/prometheus/node_exporter
194
-
cd ${GOPATH-$HOME/go}/src/github.com/prometheus/node_exporter
@@ -215,32 +273,6 @@ The exporter supports TLS via a new web configuration file.
215
273
216
274
See the [https package](https/README.md) for more details.
217
275
218
-
## Using Docker
219
-
The `node_exporter` is designed to monitor the host system. It's not recommended
220
-
to deploy it as a Docker container because it requires access to the host system.
221
-
Be aware that any non-root mount points you want to monitor will need to be bind-mounted
222
-
into the container.
223
-
224
-
If you start container for host monitoring, specify `path.rootfs` argument.
225
-
This argument must match path in bind-mount of host root. The node\_exporter will use
226
-
`path.rootfs` as prefix to access host filesystem.
227
-
228
-
```bash
229
-
docker run -d \
230
-
--net="host" \
231
-
--pid="host" \
232
-
-v "/:/host:ro,rslave" \
233
-
quay.io/prometheus/node-exporter \
234
-
--path.rootfs=/host
235
-
```
236
-
237
-
On some systems, the `timex` collector requires an additional Docker flag,
238
-
`--cap-add=SYS_TIME`, in order to access the required syscalls.
239
-
240
-
## Using a third-party repository for RHEL/CentOS/Fedora
241
-
242
-
There is a [community-supplied COPR repository](https://copr.fedorainfracloud.org/coprs/ibotty/prometheus-exporters/) which closely follows upstream releases.
0 commit comments