2015-02-09 02:41:04 -08:00
# Node exporter
2014-02-07 08:09:39 -08:00
2015-03-21 03:32:18 -07:00
[![Build Status ](https://travis-ci.org/prometheus/node_exporter.svg )](https://travis-ci.org/prometheus/node_exporter)
2015-03-18 19:04:29 -07:00
2015-02-09 02:41:04 -08:00
Prometheus exporter for machine metrics, written in Go with pluggable metric
collectors.
2014-02-07 08:09:39 -08:00
2015-02-09 13:41:51 -08:00
## Building and running
make
./node_exporter < flags >
## Running tests
make test
2015-02-09 02:41:04 -08:00
## Available collectors
2014-02-07 08:09:39 -08:00
2015-02-09 02:41:04 -08:00
By default the build will include the native collectors that expose information
2015-04-14 06:19:02 -07:00
from `/proc` .
2015-02-09 02:41:04 -08:00
2015-02-18 09:15:57 -08:00
Which collectors are used is controlled by the `--collectors.enabled` flag.
2015-02-09 02:41:04 -08:00
### Enabled by default
Name | Description
---------|------------
2015-04-14 06:19:02 -07:00
diskstats | Exposes disk I/O statistics from `/proc/diskstats` .
2015-02-09 02:41:04 -08:00
filesystem | Exposes filesystem statistics, such as disk space used.
loadavg | Exposes load average.
2015-04-14 06:19:02 -07:00
meminfo | Exposes memory statistics from `/proc/meminfo` .
netdev | Exposes network interface statistics from `/proc/netstat` , such as bytes transferred.
netstat | Exposes network statistics from `/proc/net/netstat` . This is the same information as `netstat -s` .
stat | Exposes various statistics from `/proc/stat` . This includes CPU usage, boot time, forks and interrupts.
2015-02-18 09:15:57 -08:00
textfile | Exposes statistics read from local disk. The `--collector.textfile.directory` flag must be set.
2015-02-09 02:41:04 -08:00
time | Exposes the current system time.
2015-09-11 11:15:23 -07:00
mdadm | Exposes statistics about devices in `/proc/mdstat` (does nothing if no /proc/mdstat present).
2015-02-09 02:41:04 -08:00
### Disabled by default
Name | Description
---------|------------
bonding | Exposes the number of configured and active slaves of Linux bonding interfaces.
gmond | Exposes statistics from Ganglia.
2015-04-14 06:19:02 -07:00
interrupts | Exposes detailed interrupts statistics from `/proc/interrupts` .
2015-05-05 05:49:35 -07:00
ipvs | Exposes IPVS status from `/proc/net/ip_vs` and stats from `/proc/net/ip_vs_stats` .
2015-02-09 02:41:04 -08:00
lastlogin | Exposes the last time there was a login.
megacli | Exposes RAID statistics from MegaCLI.
ntp | Exposes time drift from an NTP server.
runit | Exposes service status from [runit ](http://smarden.org/runit/ ).
2015-10-06 09:39:15 -07:00
supervisord | Exposes service status from [supervisord ](http://supervisord.org/ ).
2015-04-14 06:19:02 -07:00
tcpstat | 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.)
2015-02-09 02:41:04 -08:00
## Textfile Collector
The textfile collector is similar to the [Pushgateway ](https://github.com/prometheus/pushgateway ),
in that it allows exporting of statistics from batch jobs. It can also be used
to export static metrics, such as what role a machine has. The Pushgateway
should be used for service-level metrics. The textfile module is for metrics
that are tied to a machine.
2015-03-21 03:27:43 -07:00
To use it, set the `--collector.textfile.directory` flag on the Node exporter. The
2015-02-18 09:15:57 -08:00
collector will parse all files in that directory matching the glob `*.prom`
using the [text
format](http://prometheus.io/docs/instrumenting/exposition_formats/).
2015-02-09 02:41:04 -08:00
To atomically push completion time for a cron job:
```
echo my_batch_job_completion_time $(date +%s) > /path/to/directory/my_batch_job.prom.$$
mv /path/to/directory/my_batch_job.prom.$$ /path/to/directory/my_batch_job.prom
```
To statically set roles for a machine using labels:
```
echo 'role{role="application_server"} 1' > /path/to/directory/role.prom.$$
mv /path/to/directory/role.prom.$$ /path/to/directory/role.prom
```
2015-06-07 08:59:17 -07:00
## Using Docker
You can deploy this exporter using the [prom/node-exporter ](https://registry.hub.docker.com/u/prom/node-exporter/ ) Docker image.
For example:
```bash
docker pull prom/node-exporter
docker run -d -p 9100:9100 --net="host" prom/node-exporter
```