Installation & Configuration of Node Exporter

Node Exporter is a Prometheus exporter for server level and OS level metrics with configurable metric collectors. It helps us in measuring various server resources such as RAM, disk space, and CPU utilization.

Go to the site Prometheus.io/download copy the package of node_exporter

wget https://github.com/prometheus/node_exporter/releases/download/v1.0.0/node_exporter-1.0.0.linux-amd64.tar.gz

Extract the downloaded package.

tar -xvzf node_exporter-1.0.0.linux-amd64.tar.gz

Create a user for the node exporter.

useradd -rs /bin/false nodeusr

Move binary to “/usr/local/bin” from the downloaded extracted package.

mv node_exporter-1.0.0.linux-amd64/node_exporter /usr/local/bin/

Create a service file for the node exporter.

vim /etc/systemd/system/node_exporter.service

Add the following content to the file.

[Unit]
Description=Node Exporter
After=network.target

[Service]
User=nodeusr
Group=nodeusr
Type=simple

ExecStart=/usr/local/bin/node_exporter

[Install]
WantedBy=multi-user.target

Save and exit the file.

Reload the system daemon.

systemctl daemon-reload

Start node exporter service.

systemctl start node_exporter

Enable node exporter on system boot.

systemctl enable node_exporter

use this URL to see the metrics

http://IP-Address:9100/metrics

Then you will see this window:-

Add configured node exporter Target On Prometheus Server.

Login to Prometheus server and modify the prometheus.yml file

Edit the file:

vim /etc/prometheus/prometheus.yml

Add the following configurations under the scrape config.

– job_name: ‘node_exporter_centos’
    scrape_interval: 5s
    static_configs:
      – targets: [‘node_exporter-ip-addr:9100’]

The file should look like as follows.

Restart Prometheus service.

systemctl restart prometheus

Login to Prometheus server web interface, and check targets.

http://Prometheus-Server-IP:9090/targets

You can click the graph and query any server metrics and click execute to show output. It will show the console output.

Query Browser:

Console output:

Installation & Configuration of Node Exporter

Click on graph to view:

Installation & Configuration of Node Exporter

Python

Leave a Reply

Your email address will not be published. Required fields are marked *