ansible-infra/roles/monitoring/files/prometheus/rules/hardware.rules

44 lines
1.9 KiB
Plaintext

groups:
- name: Hardware alerts
rules:
- alert: Instancedown
expr: up == 0
for: 5m
labels:
severity: warning
annotations:
title: Instance {{ $labels.instance }} is down
description: Failed to scrape {{ $labels.job }} on {{ $labels.instance }} for more than 5 minute. Instance seems down.
- alert: LowRootDiskSpace
expr: (node_filesystem_free_bytes{device =~ "/dev/.+"} / node_filesystem_size_bytes{device =~ "/dev/.+"} * 100) < 10
for: 5m
labels:
severity: warning
annotations:
title: Low free root space on {{ $labels.instance }}
description: On {{ $labels.instance }} device {{ $labels.device }} mounted on {{ $labels.mountpoint }} has low free space of {{ $value }}%
- alert: LowDataDiskSpace
expr: (node_filesystem_free_bytes{device !~ "/dev/.+", fstype !~ "tmpfs|.*lxcfs"} / node_filesystem_size_bytes{device !~ "/dev/.+", fstype !~ "tmpfs|.*lxcfs"} * 100) < 10
for: 5m
labels:
severity: warning
annotations:
title: Low free data space on {{ $labels.instance }}
description: On {{ $labels.instance }} device {{ $labels.device }} mounted on {{ $labels.mountpoint }} has low free space of {{ $value }}%
- alert: HighCPULoad
expr: 100 - (avg by(instance) (irate(node_cpu_seconds_total{mode="idle"}[5m])) * 100) > 90
for: 5m
labels:
severity: warning
annotations:
title: High CPU load on instance {{ $labels.instance }}
description: Instance {{ $labels.instance }} has high CPU load.
- alert: HighMemoryUsage
expr: (1 - ((node_memory_MemFree_bytes + node_memory_Buffers_bytes + node_memory_Cached_bytes) / node_memory_MemTotal_bytes)) * 100 > 90
for: 5m
labels:
severity: warning
annotations:
description: Instance {{ $labels.instance }} has high memory usage
summary: High memory usage on {{ $labels.instance }}