From af5a37936d87e9c1cec986856b9ea21de20c214d Mon Sep 17 00:00:00 2001 From: Tower Date: Thu, 3 Sep 2026 19:01:14 +0200 Subject: [PATCH] Init --- .gitignore | 0 CONFIGS/PROMETHEUS/prometheus.yml | 39 ++++++++++++++++ Monitoring.code-workspace | 14 ++++++ docker-compose.yml | 75 +++++++++++++++++++++++++++++++ 4 files changed, 128 insertions(+) create mode 100644 .gitignore create mode 100644 CONFIGS/PROMETHEUS/prometheus.yml create mode 100644 Monitoring.code-workspace create mode 100644 docker-compose.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/CONFIGS/PROMETHEUS/prometheus.yml b/CONFIGS/PROMETHEUS/prometheus.yml new file mode 100644 index 0000000..acff322 --- /dev/null +++ b/CONFIGS/PROMETHEUS/prometheus.yml @@ -0,0 +1,39 @@ +# /data/PROMETHEUS/config/prometheus.yml +global: + scrape_interval: 15s + +scrape_configs: + - job_name: 'prometheus' + static_configs: + - targets: ['localhost:9090'] + + + + - job_name: 'node_exporter_node1' + static_configs: + - targets: ['10.233.1.:8008'] + + - job_name: 'cadvisor_exporter_node1' + static_configs: + - targets: ['10.233.1.:8009'] + + + + - job_name: 'node_exporter_node2' + static_configs: + - targets: ['10.233.1.:8008'] + + - job_name: 'cadvisor_exporter_node2' + static_configs: + - targets: ['10.233.1.:8009'] + + + + - job_name: 'node_exporter_node3' + static_configs: + - targets: ['10.233.1.:8008'] + + - job_name: 'cadvisor_exporter_node3' + static_configs: + - targets: ['10.233.1.:8009'] + diff --git a/Monitoring.code-workspace b/Monitoring.code-workspace new file mode 100644 index 0000000..bcaf631 --- /dev/null +++ b/Monitoring.code-workspace @@ -0,0 +1,14 @@ +{ + "folders": [ + { + "path": "." + } + ], + "settings": { + "files.exclude": { + // "**/.git": true, + // "**/WEBSERVER": true, + }, + "window.title": "Monitoring" + } +} \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..0f372c3 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,75 @@ +services: + prometheus: + image: prom/prometheus:latest + container_name: prometheus + volumes: + - ./CONFIGS/PROMETHEUS/:/etc/prometheus + - ./PROMETHEUS/:/prometheus + command: + - '--config.file=/etc/prometheus/prometheus.yml' + - '--storage.tsdb.path=/prometheus' + - '--storage.tsdb.retention.time=30d' + networks: + docker-net: + ipv4_address: 172.30.0.20 + ports: + - "127.0.0.1:9090:9090" + restart: always + + 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.sysfs=/host/sys' + - '--path.rootfs=/rootfs' + - '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)' + networks: + docker-net: + ipv4_address: 172.30.0.21 + ports: + - "8008:9100" + restart: always + + cadvisor: + image: gcr.io/cadvisor/cadvisor:latest + container_name: cadvisor + volumes: + - /:/rootfs:ro + - /var/run:/var/run:ro + - /sys:/sys:ro + - /var/lib/docker/:/var/lib/docker:ro + - /dev/disk/:/dev/disk:ro + networks: + docker-net: + ipv4_address: 172.30.0.22 + ports: + - "8009:8080" + restart: always + + grafana: + image: grafana/grafana:latest + container_name: grafana + environment: + - GF_SECURITY_ADMIN_USER=bruno + - GF_SECURITY_ADMIN_PASSWORD=svHBaMujp0c7ZE5065 + - GF_USERS_ALLOW_SIGN_UP=false + volumes: + - ./GRAFANA/data:/var/lib/grafana + ports: + - "8007:3000" + networks: + docker-net: + ipv4_address: 172.30.0.23 + restart: always + +networks: + docker-net: + driver: bridge + ipam: + config: + - subnet: 172.30.0.0/16