- [[email protected]]# wget https://github.com/prometheus/prometheus/releases/download/v2.9.2/prometheus-2.9.2.linux-amd64.tar.gz
- [[email protected]]# tar xvfz prometheus-2.92.linux-amd64.tar.gz
- [[email protected]]# mv prometheus-2.92.linux-amd64 prometheus
- [[email protected]]# cd prometheus
- [[email protected]]# cat prometheus.yaml #basic configuration
Login to the client machine
Download, extract, and running the node exporter
[[email protected]]# wget https://github.com/prometheus/node_exporter/releases/download/v0.17.0/node_exporter-0.17.0.linux-amd64.tar.gz
[[email protected]]# tar xzvf node_exporter-0.17.0.linux-amd64.tar.gz
[[email protected]]# mv node_exporter-0.17.0.linux-amd64.tar.gz node_exporter
[[email protected]]# cd node_exporter
[[email protected]]# ./node_exporter
Set node_exporter as a service
#reference : https://devopscube.com/monitor-linux-servers-prometheus-node-exporter/
[[email protected]]# cp node_exporter /usr/local/bin
[[email protected]]# useradd -rs /bin/false node_exporter
[[email protected]]# cat > /etc/systemd/system/node_exporter.service
[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
Start daemon, node_exporter and enable autostart
[[email protected]]# systemctl daemon-reload
[[email protected]]# systemctl start node_exporter
[[email protected]]# systemctl status node_exporter
[[email protected]]# systemctl enable node_exporter
Open firewall port 9100
Make sure you can access node exporter metric via http://
[[email protected]]# systemctl start grafana-server
[[email protected]]# systemctl enable grafana-server