Compare commits
3 Commits
monitoring
...
monitoring
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f91660cd0 | ||
|
|
7005255aab | ||
|
|
fb855dbbad |
@@ -15,9 +15,11 @@ receivers:
|
||||
chat_id: -1003779247128
|
||||
message: |-
|
||||
{{ range .Alerts }}
|
||||
*{{ .Labels.alertname }}* ({{ .Labels.severity }})
|
||||
{{ if eq .Labels.severity "critical" }}🔴{{ else }}⚠️{{ end }} *{{ .Labels.alertname }}* ({{ .Labels.severity }})
|
||||
{{ .Annotations.summary }}
|
||||
{{ .Annotations.description }}
|
||||
Instance: {{ .Labels.instance }}
|
||||
Details: {{ .GeneratorURL }}
|
||||
{{ end }}
|
||||
parse_mode: Markdown
|
||||
disable_notifications: false
|
||||
|
||||
19
monitoring/blackbox/blackbox.yml
Normal file
19
monitoring/blackbox/blackbox.yml
Normal 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"
|
||||
@@ -77,6 +77,14 @@ services:
|
||||
ports:
|
||||
- "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:
|
||||
prometheus-data:
|
||||
grafana-data:
|
||||
|
||||
@@ -30,3 +30,55 @@ scrape_configs:
|
||||
- job_name: revproxy-node
|
||||
static_configs:
|
||||
- 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
|
||||
|
||||
@@ -47,13 +47,13 @@ groups:
|
||||
description: "MemAvailable < 8%"
|
||||
|
||||
- alert: SwapUsageHigh
|
||||
expr: (1 - (node_memory_SwapFree_bytes / node_memory_SwapTotal_bytes)) > 0.30
|
||||
for: 15m
|
||||
expr: (1 - (node_memory_SwapFree_bytes / node_memory_SwapTotal_bytes)) > 0.50
|
||||
for: 20m
|
||||
labels:
|
||||
severity: warning
|
||||
annotations:
|
||||
summary: "Swap usage high on {{ $labels.instance }}"
|
||||
description: "Swap usage > 30%"
|
||||
description: "Swap usage > 50%"
|
||||
|
||||
- alert: DiskFull
|
||||
expr: (node_filesystem_avail_bytes{fstype!~"tmpfs|overlay"} / node_filesystem_size_bytes{fstype!~"tmpfs|overlay"}) < 0.10
|
||||
@@ -65,22 +65,22 @@ groups:
|
||||
description: "<10% free on {{ $labels.mountpoint }}"
|
||||
|
||||
- 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
|
||||
labels:
|
||||
severity: warning
|
||||
annotations:
|
||||
summary: "Disk usage >85% on {{ $labels.instance }}"
|
||||
description: "Root filesystem usage above 85%"
|
||||
description: "{{ $labels.mountpoint }} usage above 85%"
|
||||
|
||||
- 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
|
||||
labels:
|
||||
severity: critical
|
||||
annotations:
|
||||
summary: "Disk usage >95% on {{ $labels.instance }}"
|
||||
description: "Root filesystem usage above 95%"
|
||||
description: "{{ $labels.mountpoint }} usage above 95%"
|
||||
|
||||
- alert: DockerContainerDown
|
||||
expr: time() - container_last_seen > 120
|
||||
@@ -90,3 +90,21 @@ groups:
|
||||
annotations:
|
||||
summary: "Container down"
|
||||
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"
|
||||
|
||||
Reference in New Issue
Block a user