This guide explains how to install the Prometheus Node Exporter on a Linux host for system-level metrics collection.
This guide details how to set up the Prometheus Node Exporter on a Linux host. The Node Exporter collects system-level metrics and provides them in a format that Prometheus can scrape for monitoring.
Begin by visiting the official Prometheus downloads page and selecting the Node Exporter. Choose the desired version and either download the binary directly or copy the URL for use with wget.
Once you have the URL, download the tarred file using wget. For example:
Extract the downloaded tar file using the tar command:
Copy
Ask AI
tar -xvf node_exporter-1.3.1.linux-amd64.tar.gz
This command creates a directory named node_exporter-1.3.1.linux-amd64 containing the executable and additional files (LICENSE and NOTICE). Change to the directory with:
To confirm that the Node Exporter is running correctly, use curl to request the metrics endpoint:
Copy
Ask AI
curl localhost:9100/metrics
A typical response includes Prometheus-formatted metrics such as:
Copy
Ask AI
# TYPE promhttp_metric_handler_requests_in_flight gaugepromhttp_metric_handler_requests_in_flight 1# HELP promhttp_metric_handler_requests_total Total number of scrapes by HTTP status code.# TYPE promhttp_metric_handler_requests_total counterpromhttp_metric_handler_requests_total{code="200"} 0promhttp_metric_handler_requests_total{code="500"} 0promhttp_metric_handler_requests_total{code="503"} 0
The process remains the same if you are using a different version, such as node_exporter-1.4.0.linux-amd64. Your working directory may resemble:
Copy
Ask AI
user2 in ~> lsDesktop Downloads node_exporter-1.4.0.linux-amd64 Pictures pushgateway-1.4.3.linux-amd64 snap Videos Documents Music Public pushgateway-1.4.3.linux-amd64.tar.gz Templates
A sample output provides various system metrics, including CPU, memory, and network statistics:
Copy
Ask AI
# TYPE node_timex_tick_seconds gaugenode_timex_tick_seconds 0.01# HELP node_udp_queues Number of allocated memory in the kernel for UDP datagrams in bytes.# TYPE node_udp_queues gaugenode_udp_queues{ip="v4",queue="rx"} 0node_udp_queues{ip="v4",queue="tx"} 0node_udp_queues{ip="v6",queue="rx"} 0node_udp_queues{ip="v6",queue="tx"} 0# HELP node_uname_info Labeled system information as provided by the uname system call.node_uname_info{domainname="(none)",machine="x86_64",nodename="user2",release="5.15.0-52-generic",sysname="Linux",version="#58-Ubuntu SMP Thu Oct 13 08:03:55 UTC 2022"} 1...
With these steps, the Prometheus Node Exporter is now set up to collect host metrics, allowing Prometheus to scrape them from the /metrics endpoint. This installation is a key component for monitoring system performance and reliability.
For further customization and enhancements, explore additional Prometheus exporters and check out the Prometheus Documentation.