Prometheus. Monitor Linux server using Prometheus

Материал из Wiki
Перейти к навигации Перейти к поиску

At Client - Linux node (192.168.17.186)

Install linux node exporter

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

useradd -rs /bin/false nodeusr

mv node_exporter-1.3.1.linux-amd64/node_exporter /usr/local/bin/

nano /etc/systemd/system/node_exporter.service

[Unit]
Description=Node Exporter
After=network.target
[Service]
User=nodeusr
Group=nodeusr
Type=simple
ExecStart=/usr/local/bin/node_exporter
[Install]
WantedBy=multi-user.target

systemctl daemon-reload

systemctl enable node_exporter

systemctl start node_exporter

systemctl start firewalld

firewall-cmd --zone=public --add-port=9100/tcp --permanent

systemctl restart firewalld

Go to web

http://192.168.17.186:9100/metrics

At Server - Prometheus

nano /etc/prometheus/prometheus.yml

...
  - job_name: 'centos7-test01'
    scrape_interval: 5s
    static_configs:
      - targets: ['192.168.17.186:9100']

systemctl restart prometheus

Web

http://<Prometheus-Server-IP>:9090/targets

At Grafana

Look at centos7-test01 metrics

Linux node dashboard to grafana 1.jpg


Look at centos7-test01 in Prometheus

Linux node dashboard to grafana 2.jpg


Add centos7-test01 Dashboard to Grafana

Linux node dashboard to grafana 3.jpg
Linux node dashboard to grafana 4.jpg
Linux node dashboard to grafana 5.jpg
Linux node dashboard to grafana 6.jpg
Linux node dashboard to grafana 7.jpg