#!/usr/bin/env bash # # Homelab monitoring, Part 1: Prometheus and Grafana on Proxmox # https://www.zadran.net/guides/homelab-monitoring-1-prometheus-grafana # Generated from the guide, last updated 2026-10-13. # # NO WARRANTY. This script is provided as is. You are responsible for # understanding what it does before running it, and for the consequences. # Take a backup first. See https://www.zadran.net/disclaimer # # Destructive steps are left commented out on purpose -- uncomment them # only once you have understood what they do. # # Where the guide writes a file with <<'EOF' and your values are in it, # this script uses < /opt/monitoring/compose.yaml < /opt/monitoring/prometheus/prometheus.yml < /opt/monitoring/grafana/provisioning/datasources/prometheus.yml <<'EOF' apiVersion: 1 datasources: - name: Prometheus type: prometheus uid: prometheus access: proxy url: http://prometheus:9090 isDefault: true EOF cd /opt/monitoring && docker compose up -d sleep 20 docker ps --format '{{.Names}} {{.Status}}' apt update && apt install -y prometheus-node-exporter systemctl enable --now prometheus-node-exporter curl -s localhost:9100/metrics | grep -c '^node_'