diff --git a/playbooks/files/chaosknoten/configs/grafana/docker_compose/prometheus.yml b/playbooks/files/chaosknoten/configs/grafana/docker_compose/prometheus.yml index 092a310..c7905b9 100644 --- a/playbooks/files/chaosknoten/configs/grafana/docker_compose/prometheus.yml +++ b/playbooks/files/chaosknoten/configs/grafana/docker_compose/prometheus.yml @@ -65,3 +65,19 @@ scrape_configs: static_configs: - targets: - chaosknoten.hamburg.ccc.de:9100 # Node Exporter +- job_name: 'pve' + static_configs: + - targets: + - 212.12.48.126 # chaosknoten + metrics_path: /pve + params: + module: [default] + cluster: ['1'] + node: ['1'] + relabel_configs: + - source_labels: [__address__] + target_label: __param_target + - source_labels: [__param_target] + target_label: instance + - target_label: __address__ + replacement: pve-exporter:9221 diff --git a/playbooks/templates/chaosknoten/configs/grafana/compose.yaml.j2 b/playbooks/templates/chaosknoten/configs/grafana/compose.yaml.j2 index 4f8bcc0..31f3e4c 100644 --- a/playbooks/templates/chaosknoten/configs/grafana/compose.yaml.j2 +++ b/playbooks/templates/chaosknoten/configs/grafana/compose.yaml.j2 @@ -29,6 +29,20 @@ services: - ./configs/grafana-datasource.yml:/etc/grafana/provisioning/datasources/datasource.yml - graf_data:/var/lib/grafana + pve-exporter: + image: prompve/prometheus-pve-exporter + container_name: pve-exporter + ports: + - 9221:9221 + restart: unless-stopped + environment: + - PVE_USER=grafana@pve + - "PVE_PASSWORD={{ lookup("community.general.passwordstore", "noc/vm-secrets/chaosknoten/grafana/prometheus-exporter", create=false, missing="error") }}" + - PVE_VERIFY_SSL=false + volumes: + - /dev/null:/etc/prometheus/pve.yml + + volumes: graf_data: {} prom_data: {}