Node Exporter
Install Node Exporter
1.Download the latest version of Node Exporter from the link below.
https://github.com/prometheus/node_exporter/releases/latest
Example: wget https://github.com/prometheus/node_exporter/releases/download/v1.6.1/node_exporter-1.6.1.linux-amd64.tar.gz
2.Unzip the downloaded file.
tar xvfz node_exporter-1.6.1.linux-amd64.tar.gz
3.Go to the Node Exporter directory.
cd node_exporter-1.6.1.linux-amd64/
4.Copy the Node Exporter binary file to the specified directory.
cp node_exporter /usr/local/bin/
5.Create a user for Node Exporter.
useradd -rs /bin/false node_exporter
6.Change the owner of the following directory to Node Exporter.
chown node_exporter:node_exporter /usr/local/bin/node_exporter
Service File
7.Create a service file for Node Exporter with the following contents.
vim /etc/systemd/system/node_exporter.service
[Unit]
Description=Node Exporter
Wants=network-online.target
After=network-online.target
[Service]
User=node_exporter
Group=node_exporter
ExecStart=/usr/local/bin/node_exporter
[Install]
WantedBy=default.target
8.Reload the systemd daemon.
systemctl daemon-reload
Firewall
9.Add port 9100 to the firewall.
vim /etc/nftables.conf
tcp dport 9100 accept;
10.Reload the Nftables.
systemctl reload nftables
caution
Be cautious when making changes to the firewall.
Start Node Exporter
11.Start Node Exporter and check its status.
systemctl start node_exporter
systemctl enable node_exporter
systemctl status node_exporter