cài giám sát máy chủ – prometheus – node_exporter – Grafana

Loading

https://prometheus.io/download
https://github.com/prometheus/node_exporter/releases
https://grafana.com/grafana/download/10.0.0?pg=oss-graf&plcmt=hero-btn-1

sudo snap install prometheus (ubuntu)

chỉnh file sudo nano /var/snap/prometheus/nhập số/prometheus.yml 

thay port node_exporter ./node_exporter --web.listen-address=":điền port muốn chạy"

Dashboards ID: 11074

===========================================================================
WINDOWS
https://github.com/prometheus-community/windows_exporter/releases/tag/v0.22.0 

tạo file .cmd chạy trên window start prometheus.exe & start windows_exporter-0.22.0-amd64.exe --web.listen-address=:THAY PORT

Dashboards ID: 14451
===========================================================================
thay port Grafana sudo nano /etc/grafana/grafana.ini (bỏ ";"http_port = 3000)

===========================================================================
Chạy prometheusnode_exporter như một dịch vụ trên Windows
tải file NSSM
Mở Command Prompt hoặc PowerShell với quyền quản trị.
Di chuyển đến thư mục chứa nssm.exe.
Chạy lệnh sau để tạo một dịch vụ mới:
nssm install Prometheus
Một cửa sổ mới sẽ xuất hiện, cho phép bạn cấu hình dịch vụ. Đặt đường dẫn đến prometheus.exe trong trường "Path" và đường dẫn đến thư mục Prometheus trong "Startup directory". Trong trường "Arguments", nhập --config.file=prometheus.yml
Nhấn "Install Service" để cài đặt dịch vụ.
Khởi Động Dịch Vụ:
Mở "Services" trên Windows (có thể nhập "services.msc" trong Run).
Tìm dịch vụ bạn vừa tạo ("Prometheus") và khởi động nó.

nssm install node_exporter
Một cửa sổ mới sẽ xuất hiện, cho phép bạn cấu hình dịch vụ. Đặt đường dẫn đến windows_exporter.exe trong trường "Path" và đường dẫn đến thư mục windows_exporter trong "Startup directory". Trong trường "Arguments", nhập --web.listen-address=":điền port muốn chạy"
Nhấn "Install Service" để cài đặt dịch vụ.

Khởi Động Dịch Vụ:
Mở "Services" trên Windows (có thể nhập "services.msc" trong Run).
Tìm dịch vụ bạn vừa tạo ("Prometheus hoặc node_exporter") và khởi động nó.

đánh giá sản phẩm