DataLife Engine / How to install Prometheus node exporter on Linux host

How to install Prometheus node exporter on Linux host


Node Exporter exports lots of metrics (such as disk I/O statistics, CPU load, memory usage, network statistics, and more) in a format Prometheus understands.

You can install node exporter with next script:
#!/bin/bash

cd /opt/
wget https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-amd64.tar.gz
tar -xvzf node_exporter-1.3.1.linux-amd64.tar.gz 
cat <<'EOT' > /etc/systemd/system/node_exporter.service
[Unit]
Description=Node Exporter

[Service]
User=prometheus
ExecStart=/opt/node_exporter-1.3.1.linux-amd64/node_exporter

[Install]
WantedBy=default.target
EOT
systemctl daemon-reload
useradd -s /bin/false prometheus
systemctl enable --now node_exporter.service
systemctl status node_exporter.service

To run Prometheus Node Exporter on custom interface and port, use:
/opt/node_exporter-1.3.1.linux-amd64/node_exporter --web.listen-address=192.168.55.10:9101
18-07-2022, 18:55
Вернуться назад