Skip to content

๐Ÿก Homelab ๐Ÿงช

Grafana

๐Ÿ’พ Install

# amd64
bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/grafana.sh)"
# arm64
bash -c "$(wget -qLO - https://github.com/asylumexp/Proxmox/raw/main/ct/grafana.sh)"

๐Ÿ”‘ Passwordless Login

# /etc/grafana/grafana.ini
#################################### Anonymous Auth ##########################
[auth.anonymous]
# enable anonymous access
enabled = true

# specify organization name that should be used for unauthenticated users
org_name = ORGANIZATION

Prometheus

๐Ÿ’พ Install

# amd64
bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/prometheus.sh)"
# arm64
bash -c "$(wget -qLO - https://github.com/asylumexp/Proxmox/raw/main/ct/prometheus.sh)"

Enable Lifecycle Reload

# /etc/systemd/system/prometheus.service
...
ExecStart= ... --web.enable-lifecycle

Restart service

curl -X POST http://127.0.0.1:9090/-/reload

Add node

# /etc/prometheus/prometheus.yml
...
scrape_configs:
  - job_name: 'yourservername'
    static_configs:
      - targets:
        - yourserverip:9100
        labels:
          instance: 'pve01'
    metrics_path: /metrics
    scrape_interval: 60s

Node

In repo

apt install prometheus-node-exporter -y

As root and prometheus-node-exporter is not in repo

wget https://github.com/prometheus/node_exporter/releases/latest/tar.gz
tar -xvf tar.gz
cd node_exporter
mv node_exporter /usr/local/bin/
# /etc/systemd/system/node_exporter.service 
[Unit]
Description=Prometheus exporter for machine metrics
Documentation=https://github.com/prometheus/node_exporter

[Service]
Restart=on-failure
User=root
EnvironmentFile=/etc/default/prometheus-node-exporter
ExecStart=/usr/local/bin/node_exporter $ARGS
ExecReload=/bin/kill -HUP $MAINPID
TimeoutStopSec=20s
SendSIGKILL=no

[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable node_exporter.service
systemctl start node_exporter.service
journalctl -xeu node_exporter.service

Test

curl "http://localhost:9100/metrics"

๐Ÿ”— References