Pages

Thursday, April 26, 2018

Node_exporter with prometheus

Node_exporter is a hardware and machine metric collection and exporter to prometheus. The node exporter allows you to measure various machine resources such as memory, disk and CPU utilization. In this article we will see how we can configure node_exporter and export the machine and hardware metrics to prometheus
  1. Create a user node_exporter with no home
           useradd --no-create-home --shell /bin/false node_exporter
      2.  Download the node_exporter using wget
           wget https://github.com/prometheus/node_exporter/releases/download/
                     v0.16.0-rc.1/node_exporter-0.16.0-rc.1.linux-amd64.tar.gz
      3.  tar xvf node_exporter-0.16.0-rc.1.linux-amd64.tar.gz
      4. cp node_exporter-0.15.1.linux-amd64/node_exporter /usr/local/bin
      5. mv node_exporter-0.16.0-rc.1.linux-amd64 node_exporter
      6. cp node_exporter/node_exporter /usr/local/bin
      7.  chown node_exporter:node_exporter /usr/local/bin/node_exporter
      8. vi /etc/systemd/system/node_exporter.service
         Copy the below content,
     
           [Unit]
Description=Node Exporter
Wants=network-online.target
After=network-online.target
[Service]
User=node_exporter
Group=node_exporter
Type=simple
ExecStart=/usr/local/bin/node_exporter
[Install]
WantedBy=multi-user.target
  9 . systemctl start node_exporter
  10. systemctl start node_exporter
  11. systemctl enable node_exporter
Check the status to see if node_exporter is running.

No comments :

Post a Comment