Prometheus. Monitor Linux server using Prometheus: различия между версиями

Материал из Wiki
Перейти к навигации Перейти к поиску
Строка 1: Строка 1:
== At Client - Linux node (192.168.17.186) ==
== At Client - Linux node (192.168.17.186) ==
Install linux node exporter
Install linux component "'''node_exporter'''"


<code>wget <nowiki>https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-amd64.tar.gz</nowiki></code>
<code>wget <nowiki>https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-amd64.tar.gz</nowiki></code>

Версия 22:04, 23 июля 2022

At Client - Linux node (192.168.17.186)

Install linux component "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

Look at centos7-test01 metrics

Linux node dashboard to grafana 1.jpg

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

Look at centos7-test01 in Prometheus

Linux node dashboard to grafana 2.jpg

At Grafana

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