2 Commits

Author SHA1 Message Date
g4st3r
7005255aab Add blackbox exporter and HTTP alerts 2026-03-07 20:57:13 +00:00
g4st3r
fb855dbbad Alert on all filesystems usage 2026-03-07 20:49:48 +00:00
4 changed files with 101 additions and 4 deletions

View File

@@ -0,0 +1,19 @@
modules:
http_2xx:
prober: http
timeout: 5s
http:
valid_http_versions: ["HTTP/1.1", "HTTP/2.0"]
valid_status_codes: []
method: GET
follow_redirects: true
preferred_ip_protocol: "ip4"
http_5xx:
prober: http
timeout: 5s
http:
valid_http_versions: ["HTTP/1.1", "HTTP/2.0"]
valid_status_codes: [500, 501, 502, 503, 504]
method: GET
follow_redirects: true
preferred_ip_protocol: "ip4"

View File

@@ -77,6 +77,14 @@ services:
ports: ports:
- "9633:9633" - "9633:9633"
blackbox-exporter:
image: prom/blackbox-exporter:v0.25.0
restart: unless-stopped
volumes:
- ./blackbox/blackbox.yml:/etc/blackbox_exporter/config.yml:ro
ports:
- "9115:9115"
volumes: volumes:
prometheus-data: prometheus-data:
grafana-data: grafana-data:

View File

@@ -30,3 +30,55 @@ scrape_configs:
- job_name: revproxy-node - job_name: revproxy-node
static_configs: static_configs:
- targets: ["10.8.0.1:9100"] - targets: ["10.8.0.1:9100"]
- job_name: blackbox-http
metrics_path: /probe
params:
module: [http_2xx]
static_configs:
- targets:
- https://s3.g4st3r.ru
- https://minio.g4st3r.ru
- https://cloud.g4st3r.ru
- https://grafana.g4st3r.ru
- https://prometheus.g4st3r.ru
- https://alert.g4st3r.ru
- https://photos.g4st3r.ru
- https://home.g4st3r.ru
- https://gitlab.g4st3r.ru
- https://openclaw.g4st3r.ru
- https://git.g4st3r.ru
- https://bw.g4st3r.ru
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox-exporter:9115
- job_name: blackbox-5xx
metrics_path: /probe
params:
module: [http_5xx]
static_configs:
- targets:
- https://s3.g4st3r.ru
- https://minio.g4st3r.ru
- https://cloud.g4st3r.ru
- https://grafana.g4st3r.ru
- https://prometheus.g4st3r.ru
- https://alert.g4st3r.ru
- https://photos.g4st3r.ru
- https://home.g4st3r.ru
- https://gitlab.g4st3r.ru
- https://openclaw.g4st3r.ru
- https://git.g4st3r.ru
- https://bw.g4st3r.ru
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox-exporter:9115

View File

@@ -65,22 +65,22 @@ groups:
description: "<10% free on {{ $labels.mountpoint }}" description: "<10% free on {{ $labels.mountpoint }}"
- alert: DiskUsageHigh - alert: DiskUsageHigh
expr: (1 - (node_filesystem_avail_bytes{mountpoint="/",fstype!~"tmpfs|overlay"} / node_filesystem_size_bytes{mountpoint="/",fstype!~"tmpfs|overlay"})) > 0.85 expr: (1 - (node_filesystem_avail_bytes{fstype!~"tmpfs|overlay",mountpoint!~"/boot/efi"} / node_filesystem_size_bytes{fstype!~"tmpfs|overlay",mountpoint!~"/boot/efi"})) > 0.85
for: 15m for: 15m
labels: labels:
severity: warning severity: warning
annotations: annotations:
summary: "Disk usage >85% on {{ $labels.instance }}" summary: "Disk usage >85% on {{ $labels.instance }}"
description: "Root filesystem usage above 85%" description: "{{ $labels.mountpoint }} usage above 85%"
- alert: DiskUsageCritical - alert: DiskUsageCritical
expr: (1 - (node_filesystem_avail_bytes{mountpoint="/",fstype!~"tmpfs|overlay"} / node_filesystem_size_bytes{mountpoint="/",fstype!~"tmpfs|overlay"})) > 0.95 expr: (1 - (node_filesystem_avail_bytes{fstype!~"tmpfs|overlay",mountpoint!~"/boot/efi"} / node_filesystem_size_bytes{fstype!~"tmpfs|overlay",mountpoint!~"/boot/efi"})) > 0.95
for: 5m for: 5m
labels: labels:
severity: critical severity: critical
annotations: annotations:
summary: "Disk usage >95% on {{ $labels.instance }}" summary: "Disk usage >95% on {{ $labels.instance }}"
description: "Root filesystem usage above 95%" description: "{{ $labels.mountpoint }} usage above 95%"
- alert: DockerContainerDown - alert: DockerContainerDown
expr: time() - container_last_seen > 120 expr: time() - container_last_seen > 120
@@ -90,3 +90,21 @@ groups:
annotations: annotations:
summary: "Container down" summary: "Container down"
description: "A container has not been seen for >2m" description: "A container has not been seen for >2m"
- alert: HttpEndpointDown
expr: probe_success{job="blackbox-http"} == 0
for: 2m
labels:
severity: critical
annotations:
summary: "HTTP endpoint down: {{ $labels.instance }}"
description: "Blackbox probe failed"
- alert: HttpEndpoint5xx
expr: probe_success{job="blackbox-5xx"} == 1
for: 1m
labels:
severity: critical
annotations:
summary: "HTTP 5xx detected: {{ $labels.instance }}"
description: "Endpoint returned 5xx"