• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.circleci/H28-Apr-2020-

.github/H28-Apr-2020-

collector/H28-Apr-2020-

docs/H28-Apr-2020-

examples/H28-Apr-2020-

https/H28-Apr-2020-

scripts/H03-May-2022-

text_collector_examples/H28-Apr-2020-

vendor/H03-May-2022-

.dockerignoreH A D28-Apr-2020122

.gitignoreH A D28-Apr-2020406

.golangci.ymlH A D28-Apr-2020215

.promu-cgo.ymlH A D28-Apr-2020735

.promu.ymlH A D28-Apr-2020991

CHANGELOG.mdH A D28-Apr-202021.5 KiB

CONTRIBUTING.mdH A D28-Apr-20202.3 KiB

DockerfileH A D28-Apr-2020333

LICENSEH A D28-Apr-202011.1 KiB

MAINTAINERS.mdH A D28-Apr-2020104

MakefileH A D28-Apr-20204 KiB

Makefile.commonH A D28-Apr-20209 KiB

NOTICEH A D28-Apr-2020463

README.mdH A D28-Apr-202011.7 KiB

VERSIONH A D28-Apr-202011

checkmetrics.shH A D28-Apr-2020492

end-to-end-test.shH A D28-Apr-20203 KiB

example-rules.ymlH A D28-Apr-2020721

go.modH A D28-Apr-20201.3 KiB

go.sumH A D28-Apr-202046.8 KiB

node_exporter.goH A D28-Apr-20206.4 KiB

node_exporter_test.goH A D28-Apr-20203.8 KiB

staticcheck.confH A D28-Apr-202027

test_image.shH A D28-Apr-2020606

tls_config_noAuth.bad.ymlH A D28-Apr-20200

ttarH A D28-Apr-202010.8 KiB

README.md

1# Node exporter
2
3[![CircleCI](https://circleci.com/gh/prometheus/node_exporter/tree/master.svg?style=shield)][circleci]
4[![Buildkite status](https://badge.buildkite.com/94a0c1fb00b1f46883219c256efe9ce01d63b6505f3a942f9b.svg)](https://buildkite.com/prometheus/node-exporter)
5[![Docker Repository on Quay](https://quay.io/repository/prometheus/node-exporter/status)][quay]
6[![Docker Pulls](https://img.shields.io/docker/pulls/prom/node-exporter.svg?maxAge=604800)][hub]
7[![Go Report Card](https://goreportcard.com/badge/github.com/prometheus/node_exporter)][goreportcard]
8
9Prometheus exporter for hardware and OS metrics exposed by \*NIX kernels, written
10in Go with pluggable metric collectors.
11
12The [WMI exporter](https://github.com/martinlindhe/wmi_exporter) is recommended for Windows users.
13To expose NVIDIA GPU metrics, [prometheus-dcgm
14](https://github.com/NVIDIA/gpu-monitoring-tools/tree/master/exporters/prometheus-dcgm)
15can be used.
16
17## Collectors
18
19There is varying support for collectors on each operating system. The tables
20below list all existing collectors and the supported systems.
21
22Collectors are enabled by providing a `--collector.<name>` flag.
23Collectors that are enabled by default can be disabled by providing a `--no-collector.<name>` flag.
24
25### Enabled by default
26
27Name     | Description | OS
28---------|-------------|----
29arp | Exposes ARP statistics from `/proc/net/arp`. | Linux
30bcache | Exposes bcache statistics from `/sys/fs/bcache/`. | Linux
31bonding | Exposes the number of configured and active slaves of Linux bonding interfaces. | Linux
32boottime | Exposes system boot time derived from the `kern.boottime` sysctl. | Darwin, Dragonfly, FreeBSD, NetBSD, OpenBSD, Solaris
33conntrack | Shows conntrack statistics (does nothing if no `/proc/sys/net/netfilter/` present). | Linux
34cpu | Exposes CPU statistics | Darwin, Dragonfly, FreeBSD, Linux, Solaris
35cpufreq | Exposes CPU frequency statistics | Linux, Solaris
36diskstats | Exposes disk I/O statistics. | Darwin, Linux, OpenBSD
37edac | Exposes error detection and correction statistics. | Linux
38entropy | Exposes available entropy. | Linux
39exec | Exposes execution statistics. | Dragonfly, FreeBSD
40filefd | Exposes file descriptor statistics from `/proc/sys/fs/file-nr`. | Linux
41filesystem | Exposes filesystem statistics, such as disk space used. | Darwin, Dragonfly, FreeBSD, Linux, OpenBSD
42hwmon | Expose hardware monitoring and sensor data from `/sys/class/hwmon/`. | Linux
43infiniband | Exposes network statistics specific to InfiniBand and Intel OmniPath configurations. | Linux
44ipvs | Exposes IPVS status from `/proc/net/ip_vs` and stats from `/proc/net/ip_vs_stats`. | Linux
45loadavg | Exposes load average. | Darwin, Dragonfly, FreeBSD, Linux, NetBSD, OpenBSD, Solaris
46mdadm | Exposes statistics about devices in `/proc/mdstat` (does nothing if no `/proc/mdstat` present). | Linux
47meminfo | Exposes memory statistics. | Darwin, Dragonfly, FreeBSD, Linux, OpenBSD
48netclass | Exposes network interface info from `/sys/class/net/` | Linux
49netdev | Exposes network interface statistics such as bytes transferred. | Darwin, Dragonfly, FreeBSD, Linux, OpenBSD
50netstat | Exposes network statistics from `/proc/net/netstat`. This is the same information as `netstat -s`. | Linux
51nfs | Exposes NFS client statistics from `/proc/net/rpc/nfs`. This is the same information as `nfsstat -c`. | Linux
52nfsd | Exposes NFS kernel server statistics from `/proc/net/rpc/nfsd`. This is the same information as `nfsstat -s`. | Linux
53pressure | Exposes pressure stall statistics from `/proc/pressure/`. | Linux (kernel 4.20+ and/or [CONFIG\_PSI](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/accounting/psi.txt))
54rapl | Exposes various statistics from `/sys/class/powercap`. | Linux
55schedstat | Exposes task scheduler statistics from `/proc/schedstat`. | Linux
56sockstat | Exposes various statistics from `/proc/net/sockstat`. | Linux
57softnet | Exposes statistics from `/proc/net/softnet_stat`. | Linux
58stat | Exposes various statistics from `/proc/stat`. This includes boot time, forks and interrupts. | Linux
59textfile | Exposes statistics read from local disk. The `--collector.textfile.directory` flag must be set. | _any_
60thermal\_zone | Exposes thermal zone & cooling device statistics from `/sys/class/thermal`. | Linux
61time | Exposes the current system time. | _any_
62timex | Exposes selected adjtimex(2) system call stats. | Linux
63udp_queues | Exposes UDP total lengths of the rx_queue and tx_queue from `/proc/net/udp` and `/proc/net/udp6`. | Linux
64uname | Exposes system information as provided by the uname system call. | Darwin, FreeBSD, Linux, OpenBSD
65vmstat | Exposes statistics from `/proc/vmstat`. | Linux
66xfs | Exposes XFS runtime statistics. | Linux (kernel 4.4+)
67zfs | Exposes [ZFS](http://open-zfs.org/) performance statistics. | [Linux](http://zfsonlinux.org/), Solaris
68
69### Disabled by default
70
71The perf collector may not work by default on all Linux systems due to kernel
72configuration and security settings. To allow access, set the following sysctl
73parameter:
74
75```
76sysctl -w kernel.perf_event_paranoid=X
77```
78
79- 2 allow only user-space measurements (default since Linux 4.6).
80- 1 allow both kernel and user measurements (default before Linux 4.6).
81- 0 allow access to CPU-specific data but not raw tracepoint samples.
82- -1 no restrictions.
83
84Depending on the configured value different metrics will be available, for most
85cases `0` will provide the most complete set. For more information see [`man 2
86perf_event_open`](http://man7.org/linux/man-pages/man2/perf_event_open.2.html).
87
88By default, the perf collector will only collect metrics of the CPUs that
89`node_exporter` is running on (ie
90[`runtime.NumCPU`](https://golang.org/pkg/runtime/#NumCPU). If this is
91insufficient (e.g. if you run `node_exporter` with its CPU affinity set to
92specific CPUs), you can specify a list of alternate CPUs by using the
93`--collector.perf.cpus` flag. For example, to collect metrics on CPUs 2-6, you
94would specify: `--collector.perf --collector.perf.cpus=2-6`. The CPU
95configuration is zero indexed and can also take a stride value; e.g.
96`--collector.perf --collector.perf.cpus=1-10:5` would collect on CPUs
971, 5, and 10.
98
99The perf collector is also able to collect
100[tracepoint](https://www.kernel.org/doc/html/latest/core-api/tracepoint.html)
101counts when using the `--collector.perf.tracepoint` flag. Tracepoints can be
102found using [`perf list`](http://man7.org/linux/man-pages/man1/perf.1.html) or
103from debugfs. And example usage of this would be
104`--collector.perf.tracepoint="sched:sched_process_exec"`.
105
106
107Name     | Description | OS
108---------|-------------|----
109buddyinfo | Exposes statistics of memory fragments as reported by /proc/buddyinfo. | Linux
110devstat | Exposes device statistics | Dragonfly, FreeBSD
111drbd | Exposes Distributed Replicated Block Device statistics (to version 8.4) | Linux
112interrupts | Exposes detailed interrupts statistics. | Linux, OpenBSD
113ksmd | Exposes kernel and system statistics from `/sys/kernel/mm/ksm`. | Linux
114logind | Exposes session counts from [logind](http://www.freedesktop.org/wiki/Software/systemd/logind/). | Linux
115meminfo\_numa | Exposes memory statistics from `/proc/meminfo_numa`. | Linux
116mountstats | Exposes filesystem statistics from `/proc/self/mountstats`. Exposes detailed NFS client statistics. | Linux
117ntp | Exposes local NTP daemon health to check [time](./docs/TIME.md) | _any_
118processes | Exposes aggregate process statistics from `/proc`. | Linux
119qdisc | Exposes [queuing discipline](https://en.wikipedia.org/wiki/Network_scheduler#Linux_kernel) statistics | Linux
120runit | Exposes service status from [runit](http://smarden.org/runit/). | _any_
121supervisord | Exposes service status from [supervisord](http://supervisord.org/). | _any_
122systemd | Exposes service and system status from [systemd](http://www.freedesktop.org/wiki/Software/systemd/). | Linux
123tcpstat | Exposes TCP connection status information from `/proc/net/tcp` and `/proc/net/tcp6`. (Warning: the current version has potential performance issues in high load situations.) | Linux
124wifi | Exposes WiFi device and station statistics. | Linux
125perf | Exposes perf based metrics (Warning: Metrics are dependent on kernel configuration and settings). | Linux
126
127### Textfile Collector
128
129The textfile collector is similar to the [Pushgateway](https://github.com/prometheus/pushgateway),
130in that it allows exporting of statistics from batch jobs. It can also be used
131to export static metrics, such as what role a machine has. The Pushgateway
132should be used for service-level metrics. The textfile module is for metrics
133that are tied to a machine.
134
135To use it, set the `--collector.textfile.directory` flag on the Node exporter. The
136collector will parse all files in that directory matching the glob `*.prom`
137using the [text
138format](http://prometheus.io/docs/instrumenting/exposition_formats/). **Note:** Timestamps are not supported.
139
140To atomically push completion time for a cron job:
141```
142echo my_batch_job_completion_time $(date +%s) > /path/to/directory/my_batch_job.prom.$$
143mv /path/to/directory/my_batch_job.prom.$$ /path/to/directory/my_batch_job.prom
144```
145
146To statically set roles for a machine using labels:
147```
148echo 'role{role="application_server"} 1' > /path/to/directory/role.prom.$$
149mv /path/to/directory/role.prom.$$ /path/to/directory/role.prom
150```
151
152### Filtering enabled collectors
153
154The `node_exporter` will expose all metrics from enabled collectors by default.  This is the recommended way to collect metrics to avoid errors when comparing metrics of different families.
155
156For advanced use the `node_exporter` can be passed an optional list of collectors to filter metrics. The `collect[]` parameter may be used multiple times.  In Prometheus configuration you can use this syntax under the [scrape config](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#<scrape_config>).
157
158```
159  params:
160    collect[]:
161      - foo
162      - bar
163```
164
165This can be useful for having different Prometheus servers collect specific metrics from nodes.
166
167## Building and running
168
169Prerequisites:
170
171* [Go compiler](https://golang.org/dl/)
172* RHEL/CentOS: `glibc-static` package.
173
174Building:
175
176    go get github.com/prometheus/node_exporter
177    cd ${GOPATH-$HOME/go}/src/github.com/prometheus/node_exporter
178    make
179    ./node_exporter <flags>
180
181To see all available configuration flags:
182
183    ./node_exporter -h
184
185## Running tests
186
187    make test
188
189## TLS endpoint
190
191** EXPERIMENTAL **
192
193The exporter supports TLS via a new web configuration file.
194
195```console
196./node_exporter --web.config=web-config.yml
197```
198
199See the [https package](https/README.md) for more details.
200
201## Using Docker
202The `node_exporter` is designed to monitor the host system. It's not recommended
203to deploy it as a Docker container because it requires access to the host system.
204Be aware that any non-root mount points you want to monitor will need to be bind-mounted
205into the container.
206If you start container for host monitoring, specify `path.rootfs` argument.
207This argument must match path in bind-mount of host root. The node\_exporter will use
208`path.rootfs` as prefix to access host filesystem.
209
210```bash
211docker run -d \
212  --net="host" \
213  --pid="host" \
214  -v "/:/host:ro,rslave" \
215  quay.io/prometheus/node-exporter \
216  --path.rootfs=/host
217```
218
219On some systems, the `timex` collector requires an additional Docker flag,
220`--cap-add=SYS_TIME`, in order to access the required syscalls.
221
222## Using a third-party repository for RHEL/CentOS/Fedora
223
224There is a [community-supplied COPR repository](https://copr.fedorainfracloud.org/coprs/ibotty/prometheus-exporters/) which closely follows upstream releases.
225
226[travis]: https://travis-ci.org/prometheus/node_exporter
227[hub]: https://hub.docker.com/r/prom/node-exporter/
228[circleci]: https://circleci.com/gh/prometheus/node_exporter
229[quay]: https://quay.io/repository/prometheus/node-exporter
230[goreportcard]: https://goreportcard.com/report/github.com/prometheus/node_exporter
231