Node Exporter setup

In order for Prometheus to collect monitoring data from clients' systems, you need to install the Node Exporter software on each of the client systems.

This section describes the steps to install the Prometheus Node Exporter on the client systems.

Required components

Architecture

The figure shows an installed instance of Node Exporter and its connection to Prometheus on an LPAR.

Figure 1. Node Exporter architecture
Node Exporter Architecture

The installation steps are as follows:

1. On each client system download and compile the package from Node Exporter Source Repository. Alternatively, check your IT policy to see if you can download the pre-compiled package for the "s390x" architecture from Node Exporter GitHub Repository. The pre-compiled package is used for this use case.

 # wget  https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-x.x.x.linux-s390x.tar.gz
Note: Replace x.x.x with a version number.
2. Extract the downloaded tarball into a folder of your choice:
 # tar xvfz node_exporter-x.x.x.linux-s390x.tar.gz

3. Run the ./node_exporter from the extracted folder:

 # cd node_exporter-x.x.x.linux-s390x
 # ./node_exporter

4. After the installation has completed, run the curl command to list the metrics:

 # curl http://192.168.122.1:9100/metrics

Output:

 # HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles.
 # TYPE go_gc_duration_seconds summary
 go_gc_duration_seconds{quantile="0"} 1.0176e-05
 go_gc_duration_seconds{quantile="0.25"} 2.4458e-05
 go_gc_duration_seconds{quantile="0.5"} 7.7849e-05
 go_gc_duration_seconds{quantile="0.75"} 9.5975e-05
 go_gc_duration_seconds{quantile="1"} 0.000231828
 go_gc_duration_seconds_sum 40.020943673
 go_gc_duration_seconds_count 610331
 # HELP go_goroutines Number of goroutines that currently exist.
 # TYPE go_goroutines gauge
 go_goroutines 8

5. On the Prometheus server system, add the target Node Exporter parameters to the prometheus.yml file:

 # vi /etc/prometheus/prometheus.yml

Add the target detail under the scrape_configs section. For this use case we have defined the three targets 192.168.122.1:9100, 192.168.122.2:9100 and 192.168.122.3:9100, where the 3 instances of Node Exporter are installed.

 scrape_configs:
 - job_name: node_exporter
   scrape_interval: 15s
   static_configs:
 - targets:
   - 192.168.122.1:9100
   - 192.168.122.2:9100
   - 192.168.122.3:9100

6. Restart the Prometheus service:

 # systemctl restart prometheus.service

7. From the Prometheus dashboard, verify the connection under Status -> Target:

Figure 2. Node Exporter targets
Node Exporter targets

The next sections describe how to complete the setup on the LPARs: