services:prometheus
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| services:prometheus [2026/02/07 00:47] – created - external edit 127.0.0.1 | services:prometheus [2026/02/08 08:35] (current) – created - external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Prometheus + Grafana ====== | ====== Prometheus + Grafana ====== | ||
| - | Infrastructure monitoring with Prometheus and Grafana. | + | Metrics Collection und Visualisierung. |
| - | ===== Access | + | ===== Details |
| - | ^ Service | + | ^ Key ^ Value ^ |
| - | | Grafana | + | | Container |
| - | | Prometheus | + | | IP | 10.100.161.115 | |
| - | | Container | + | | Prometheus |
| - | | IP | 10.100.161.115 | | | + | | Grafana Port | 3000 | |
| + | | RAM | 1 GB | | ||
| + | | URL | https:// | ||
| - | **Default Login:** admin / admin (change on first login!) | + | ===== Komponenten ===== |
| - | ===== Installation ===== | + | ==== Prometheus |
| - | ==== Container ==== | + | Time-series Database für Metriken. |
| - | < | + | < |
| - | pct create 115 local: | + | /opt/ |
| - | | + | ├── prometheus |
| - | | + | ├── prometheus.yml |
| - | | + | └── data/ # TSDB |
| - | --net0 name=eth0, | + | |
| - | --features nesting=1 \ | + | |
| - | --unprivileged 1 \ | + | |
| - | --onboot 1 | + | |
| </ | </ | ||
| - | ==== Prometheus | + | ==== Grafana |
| - | <code bash> | + | Dashboards und Visualisierung. |
| - | useradd --no-create-home --shell /bin/false prometheus | + | |
| - | mkdir -p / | + | |
| - | cd /tmp | + | < |
| - | wget https://github.com/prometheus/prometheus/ | + | /var/lib/grafana/ # Data |
| - | tar xzf prometheus-*.tar.gz | + | /etc/grafana/ # Config |
| - | cd prometheus-*/ | + | |
| - | cp prometheus promtool / | + | |
| - | cp prometheus.yml | + | |
| - | chown -R prometheus: | + | |
| </ | </ | ||
| - | Systemd service: / | + | ===== Targets ===== |
| - | ==== Grafana ==== | + | Alle Hosts laufen **node_exporter** auf Port 9100: |
| - | <code bash> | + | ^ Host ^ IP ^ |
| - | apt install -y apt-transport-https software-properties-common | + | | prometheus | 10.100.161.115 | |
| - | wget -q -O / | + | | openclaw | 10.100.160.249 | |
| - | echo "deb [signed-by=/ | + | | traefik | 10.100.161.102 | |
| - | apt update && apt install -y grafana | + | | postgres | 10.100.161.110 | |
| - | systemctl enable | + | | n8n | 10.100.161.111 | |
| - | </ | + | | vaultwarden | 10.100.161.112 | |
| + | | dokuwiki | 10.100.161.113 | | ||
| + | | uptime-kuma | 10.100.161.114 | | ||
| + | | forgejo | 10.100.161.116 | | ||
| + | | hv-04 | 10.100.160.100 | | ||
| - | ===== Prometheus Config | + | ===== Dashboards |
| - | / | + | Empfohlene Grafana Dashboards: |
| - | <code yaml> | + | ^ Name ^ ID ^ |
| - | global: | + | | Node Exporter Full | 1860 | |
| - | | + | | Docker | 893 | |
| + | | PostgreSQL | 9628 | | ||
| - | scrape_configs: | + | Import: Grafana → Dashboards → Import → ID eingeben |
| - | - job_name: " | + | |
| - | static_configs: | + | |
| - | - targets: [" | + | |
| - | - job_name: " | + | ===== Service |
| - | static_configs: | + | |
| - | - targets: | + | |
| - | - " | + | |
| - | - " | + | |
| - | - " | + | |
| - | - " | + | |
| - | - " | + | |
| - | - " | + | |
| - | - " | + | |
| - | - " | + | |
| - | - " | + | |
| - | </ | + | |
| - | + | ||
| - | ===== Node Exporter | + | |
| - | + | ||
| - | Installiert auf allen 9 Hosts (Port 9100). | + | |
| <code bash> | <code bash> | ||
| - | wget https:// | + | systemctl status |
| - | tar xzf node_exporter-*.tar.gz | + | |
| - | cp node_exporter-*/ | + | |
| - | # + systemd service | + | |
| - | systemctl enable --now node_exporter | + | |
| </ | </ | ||
| - | ===== Grafana Setup ===== | + | ===== Ansible |
| - | + | ||
| - | - Login: https:// | + | |
| - | - Data Source: Configuration → Data Sources → Prometheus → URL: http:// | + | |
| - | - Dashboard: + → Import → ID 1860 (Node Exporter Full) | + | |
| - | + | ||
| - | ===== Management | + | |
| <code bash> | <code bash> | ||
| - | # Status | + | ansible-playbook site.yml |
| - | pct exec 115 -- systemctl status prometheus grafana-server | + | |
| - | + | ||
| - | # Logs | + | |
| - | pct exec 115 -- journalctl -u prometheus -f | + | |
| - | pct exec 115 -- journalctl -u grafana-server -f | + | |
| - | + | ||
| - | # Prometheus config reload | + | |
| - | pct exec 115 -- kill -HUP $(pgrep prometheus) | + | |
| </ | </ | ||
| - | ===== Related | + | ===== Links ===== |
| - | * [[services:uptime-kuma|Uptime Kuma]] - Status page | + | * [[https:// |
| - | * [[infrastructure: | + | * [[https:// |
| + | * [[infrastructure: | ||
services/prometheus.1770425233.txt.gz · Last modified: by 127.0.0.1
