This commit is contained in:
Thomas Kruse
2026-02-03 22:29:46 +01:00
commit 8fdf5827e4
156 changed files with 23069 additions and 0 deletions

View File

@ -0,0 +1,57 @@
version: '3.8'
services:
mosquitto:
image: eclipse-mosquitto:latest
container_name: mosquitto
ports:
- "1883:1883"
- "9001:9001"
volumes:
- ./mosquitto.conf:/mosquitto/config/mosquitto.conf
mosquitto-exporter:
image: sapcc/mosquitto-exporter:latest
container_name: mosquitto-exporter
environment:
- "BROKER_ENDPOINT=tcp://mosquitto:1883"
depends_on:
- mosquitto
node-exporter:
image: prom/node-exporter:latest
container_name: node-exporter
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.rootfs=/rootfs'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
prometheus:
image: prom/prometheus:latest
container_name: prometheus
volumes:
- ./prometheus.yaml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
ports:
- "9090:9090"
grafana:
image: grafana/grafana:latest
container_name: grafana
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
volumes:
- grafana_data:/var/lib/grafana
- ./grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
- ./grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards
volumes:
prometheus_data:
grafana_data:

View File

@ -0,0 +1,49 @@
version: '3.8'
services:
mosquitto-exporter:
image: sapcc/mosquitto-exporter:latest
container_name: mosquitto-exporter
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
- "BROKER_ENDPOINT=tcp://host.docker.internal:1883"
node-exporter:
image: prom/node-exporter:latest
container_name: node-exporter
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.rootfs=/rootfs'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
prometheus:
image: prom/prometheus:latest
container_name: prometheus
volumes:
- ./prometheus.yaml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
ports:
- "9090:9090"
grafana:
image: grafana/grafana:latest
container_name: grafana
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
volumes:
- grafana_data:/var/lib/grafana
- ./grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
- ./grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards
volumes:
prometheus_data:
grafana_data:

View File

@ -0,0 +1,14 @@
apiVersion: 1
providers:
- name: 'Default'
orgId: 1
folder: ''
type: file
disableDeletion: false
editable: true
options:
path: /etc/grafana/provisioning/dashboards
jsonData:
DS_PROMETHEUS: Prometheus
DS_LOCALHOST: Prometheus

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
access: proxy
url: http://prometheus:9090
isDefault: true

View File

@ -0,0 +1,18 @@
= Monitoring Prometheus
Verwenden Sie Prometheus und Grafana, z.B. aus dem beigefügten docker-compose Setup.
$ docker compose up
(In docker bereits vorkonfiguriert:)
Konfigurieren Sie den Prometheus-Exporter als Scrape Target in Prometheus.
Installieren Sie die Dashboards: 1860, 11054, 22739
scrape_configs:
- job_name: 'mosquitto'
static_configs:
- targets: ['mosquitto-exporter:9234']
Rufen Sie Grafana über http://localhost:3000 auf.
Sie können sich mittels "admin/admin" anmelden.

View File

@ -0,0 +1,8 @@
listener 1883
listener_allow_anonymous true
persistence true
persistence_location /mosquitto/data/
#log_dest file /mosquitto/log/mosquitto.log
sys_interval 10

View File

@ -0,0 +1,37 @@
global:
scrape_interval: 15s
scrape_configs:
- job_name: 'mosquitto'
static_configs:
- targets: ['mosquitto-exporter:9234']
- job_name: 'node-exporter'
static_configs:
- targets: ['node-exporter:9100']
- job_name: prometheus
honor_timestamps: true
track_timestamps_staleness: false
scrape_interval: 15s
scrape_timeout: 10s
scrape_protocols:
- OpenMetricsText1.0.0
- OpenMetricsText0.0.1
- PrometheusText1.0.0
- PrometheusText0.0.4
scrape_native_histograms: false
always_scrape_classic_histograms: false
convert_classic_histograms_to_nhcb: false
metrics_path: /metrics
scheme: http
enable_compression: true
metric_name_validation_scheme: utf8
metric_name_escaping_scheme: allow-utf-8
follow_redirects: true
enable_http2: true
static_configs:
- targets:
- localhost:9090
labels:
app: prometheus