Initial commit: working state

This commit is contained in:
2026-04-15 05:00:04 +00:00
commit 519335d856
9 changed files with 341 additions and 0 deletions
+78
View File
@@ -0,0 +1,78 @@
volumes:
prometheus_data: {}
grafana_data: {}
influxdb_data: {}
networks:
front-tier:
back-tier:
proxy_tier:
name: proxy_tier
external: true
services:
fritz-exporter:
image: pdreker/fritz_exporter:2
container_name: fritz-exporter
restart: always
environment:
FRITZ_HOSTNAME: '192.168.178.1'
FRITZ_USERNAME: 'fritz9297'
FRITZ_PASSWORD: 'VeNuocNuocVe26!'
ports:
- "9787:9787"
networks:
- back-tier
prometheus:
image: prom/prometheus:latest
volumes:
- ./prometheus/:/etc/prometheus/
- prometheus_data:/prometheus
- ./web.yml:/etc/config/web.yml
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
# - '--web.config.file=/etc/config/web.yml'
ports:
- 9090:9090
networks:
- back-tier
restart: always
# deploy:
# placement:
# constraints:
# - node.hostname == ${HOSTNAME}
grafana:
image: grafana/grafana
user: "472"
depends_on:
- prometheus
ports:
- 3300:3000
expose:
- "3000"
volumes:
- grafana_data:/var/lib/grafana
- ./grafana/provisioning/:/etc/grafana/provisioning/
env_file:
- ./grafana/config.monitoring
networks:
- back-tier
- front-tier
- proxy_tier
restart: always
labels:
- "traefik.enable=true"
# HTTP to HTTPS Redirect
- "traefik.http.routers.grafana.entrypoints=websecure"
- "traefik.http.routers.grafana.rule=Host(`grafana.quangkhai.ch`)"
- "traefik.http.routers.grafana.tls.certresolver=myresolver"
- "traefik.http.services.grafana.loadbalancer.server.port=3000"
- "traefik.docker.network=proxy_tier"
+53
View File
@@ -0,0 +1,53 @@
# my global config
global:
scrape_interval: 15s # By default, scrape targets every 15 seconds.
evaluation_interval: 15s # By default, scrape targets every 15 seconds.
# scrape_timeout is set to the global default (10s).
# Attach these labels to any time series or alerts when communicating with
# external systems (federation, remote storage, Alertmanager).
external_labels:
monitor: 'my-project'
# Load and evaluate rules in this file every 'evaluation_interval' seconds.
rule_files:
- 'alert.rules'
# - "first.rules"
# - "second.rules"
# alert
alerting:
alertmanagers:
- scheme: http
static_configs:
- targets:
- "alertmanager:9093"
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
# Override the global default and scrape targets
- job_name: 'fritz-exporter'
scrape_interval: 15s
static_configs:
- targets: ['fritz-exporter:9787']
- job_name: 'cadvisor'
# Override the global default and scrape targets from this job every 5 seconds.
scrape_interval: 15s
static_configs:
- targets: ['192.168.1.7:8080']
labels:
room: 'serverroom'
host: 'olivia'
- job_name: node
static_configs:
- targets: ['192.168.1.7:9100']
labels:
room: 'serverroom'
host: 'olivia'