Node exporter
Installation of node exporter
Download the package from the github repository
cd /tmp
wget <link to the last release>
tar xvfz node_exporter-*.*-amd64.tar.gz
sudo mv node_exporter-0.18.1.*.linux-amd64/node_exporter /usr/local/bin/
chmod +x /usr/local/bin/node_exporter
./node_exporter
Then try to get the metrics with a curl command:
curl http://localhost:9100/metrics
Create a systemctl task
First create a nonlogin user to run the task
sudo useradd -rs /bin/false node_exporter
Create a systemctl file
sudo vim /etc/systemd/system/node_exporter.service
Past the following in it
[Unit]
Description=Node Exporter
After=network.target
[Service]
User=node_exporter
Group=node_exporter
Type=simple
ExecStart=/usr/local/bin/node_exporter
[Install]
WantedBy=multi-user.target
Then restart the systemctl daemon, start the task and enable it at system start up
sudo systemctl daemon-reload
sudo systemctl start node_exporter
sudo systemctl enable node_exporter
sudo systemctl status node_exporter