Prometheus. Monitor Linux server using Prometheus

Материал из Wiki
Версия от 11:51, 21 июля 2022; Cless (обсуждение | вклад) (Новая страница: «== At Client - Linux node (192.168.199.181) == Install linux node exporter <code>wget <nowiki>https://github.com/prometheus/node_exporter/releases/download/v0.17...»)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к навигации Перейти к поиску

At Client - Linux node (192.168.199.181)

Install linux node exporter

wget https://github.com/prometheus/node_exporter/releases/download/v0.17.0/node_exporter-0.17.0.linux-amd64.tar.gz

tar -xvzf node_exporter-0.17.0.linux-amd64.tar.gz

useradd -rs /bin/false nodeusr

mv node_exporter-0.17.0.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

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

systemctl restart firewalld

Go to web

http://IP-Address:9100/metrics

At Server - Prometheus

nano /etc/prometheus/prometheus.yml

...
  - job_name: 'node_exporter_centos'
    scrape_interval: 5s
    static_configs:
      - targets: ['192.168.199.181:9100']

systemctl restart prometheus

Web

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

You can click the graph and query any server metrics and click execute to show output. It will show the console output.