User Tools

Site Tools


services:prometheus

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
services:prometheus [2026/02/07 00:47] – created - external edit 127.0.0.1services: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 URL ^ Port +Key Value 
-Grafana [[https://monitoring.home.miskam.xyz]] | 3000 +Container CT 115 | 
-| Prometheus | [[https://prometheus.home.miskam.xyz]] | 9090 | +| IP | 10.100.161.115 
-Container CT 115 | | +| Prometheus Port | 9090 | 
-IP 10.100.161.115 | |+Grafana Port 3000 | 
 +| RAM | 1 GB 
 +URL https://monitoring.home.miskam.xyz |
  
-**Default Login:** admin / admin (change on first login!)+===== Komponenten =====
  
-===== Installation =====+==== Prometheus ====
  
-==== Container ====+Time-series Database für Metriken.
  
-<code bash+<code> 
-pct create 115 local:vztmpl/debian-12-standard_12.12-1_amd64.tar.zst \ +/opt/prometheus/ 
-  --hostname monitoring \ +├── prometheus           # Binary 
-  --memory 1024 --swap 512 \ +├── prometheus.yml       # Config 
-  --cores 2 \ +└── data               # TSDB
-  --net0 name=eth0,bridge=vmbr0,ip=10.100.161.115/23,gw=10.100.161.254 \ +
-  --features nesting=1 \ +
-  --unprivileged 1 \ +
-  --onboot 1+
 </code> </code>
  
-==== Prometheus ====+==== Grafana ====
  
-<code bash> +Dashboards und Visualisierung.
-useradd --no-create-home --shell /bin/false prometheus +
-mkdir -p /etc/prometheus /var/lib/prometheus+
  
-cd /tmp +<code> 
-wget https://github.com/prometheus/prometheus/releases/download/v3.2.1/prometheus-3.2.1.linux-amd64.tar.gz +/var/lib/grafana       # Data 
-tar xzf prometheus-*.tar.gz +/etc/grafana           # Config
-cd prometheus-*/ +
-cp prometheus promtool /usr/local/bin/ +
-cp prometheus.yml /etc/prometheus/ +
-chown -R prometheus:prometheus /etc/prometheus /var/lib/prometheus+
 </code> </code>
  
-Systemd service: /etc/systemd/system/prometheus.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 /usr/share/keyrings/grafana.key https://apt.grafana.com/gpg.key +| openclaw | 10.100.160.249 | 
-echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com stable main" > /etc/apt/sources.list.d/grafana.list +| traefik | 10.100.161.102 | 
-apt update && apt install -y grafana +| postgres | 10.100.161.110 | 
-systemctl enable --now grafana-server +| n8n | 10.100.161.111 | 
-</code>+| 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 =====
  
-/etc/prometheus/prometheus.yml:+Empfohlene Grafana Dashboards:
  
-<code yaml> +^ Name ^ ID ^ 
-global: +| Node Exporter Full | 1860 | 
-  scrape_interval: 15s+| Docker | 893 | 
 +| PostgreSQL | 9628 |
  
-scrape_configs: +ImportGrafana → Dashboards → Import → ID eingeben
-  - job_name: "prometheus" +
-    static_configs: +
-      - targets: ["localhost:9090"]+
  
-  - job_name: "node" +===== Service =====
-    static_configs: +
-      - targets: +
-        - "10.100.161.102:9100"  # traefik +
-        - "10.100.160.100:9100"  # hv-04 +
-        - "10.100.160.249:9100"  # openclaw +
-        - "10.100.161.110:9100"  # postgres +
-        - "10.100.161.111:9100"  # n8n +
-        - "10.100.161.112:9100"  # vaultwarden +
-        - "10.100.161.113:9100"  # dokuwiki +
-        - "10.100.161.114:9100"  # uptime-kuma +
-        - "10.100.161.115:9100"  # monitoring +
-</code> +
- +
-===== Node Exporter ===== +
- +
-Installiert auf allen 9 Hosts (Port 9100).+
  
 <code bash> <code bash>
-wget https://github.com/prometheus/node_exporter/releases/download/v1.9.0/node_exporter-1.9.0.linux-amd64.tar.gz +systemctl status prometheus grafana-server
-tar xzf node_exporter-*.tar.gz +
-cp node_exporter-*/node_exporter /usr/local/bin/ +
-# + systemd service +
-systemctl enable --now node_exporter+
 </code> </code>
  
-===== Grafana Setup ===== +===== Ansible =====
- +
-  - Login: https://monitoring.home.miskam.xyz (admin/admin) +
-  - Data Source: Configuration → Data Sources → Prometheus → URL: http://localhost:9090 +
-  - Dashboard: + → Import → ID 1860 (Node Exporter Full) +
- +
-===== Management =====+
  
 <code bash> <code bash>
-# Status +ansible-playbook site.yml --limit monitoring
-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)+
 </code> </code>
  
-===== Related =====+===== Links =====
  
-  * [[services:uptime-kuma|Uptime Kuma]] - Status page +  * [[https://prometheus.io/docs/|Prometheus Docs]] 
-  * [[infrastructure:containers|Containers]] - CT 115 details+  * [[https://grafana.com/docs/|Grafana Docs]] 
 +  * [[infrastructure:monitoring|Monitoring Setup]]
  
services/prometheus.1770425233.txt.gz · Last modified: by 127.0.0.1