Skip to main content
APA
Sponsored by CAST AI — Kubernetes cost optimization Better Stack — Uptime monitoring and log management
⚠️

Alert thresholds depend on the nature of your applications. Some queries may have arbitrary tolerance thresholds. Building an efficient monitoring platform takes time. 😉

ZFS Prometheus Alert Rules

4 Prometheus alerting rules for ZFS. Exported via node-exporter, ZFS exporter. These rules cover critical and warning conditions — copy and paste the YAML into your Prometheus configuration.

10.2.1. node-exporter (1 rules)

wget https://raw.githubusercontent.com/samber/awesome-prometheus-alerts/refs/heads/master/dist/rules/zfs/node-exporter.yml
critical

10.2.1.1. ZFS offline pool

A ZFS zpool is in a unexpected state: {{ $labels.state }}.

- alert: ZFSOfflinePool
  expr: node_zfs_zpool_state{state!="online"} > 0
  for: 1m
  labels:
    severity: critical
  annotations:
    summary: ZFS offline pool (instance {{ $labels.instance }})
    description: "A ZFS zpool is in a unexpected state: {{ $labels.state }}.\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"

10.2.2. ZFS exporter (3 rules)

wget https://raw.githubusercontent.com/samber/awesome-prometheus-alerts/refs/heads/master/dist/rules/zfs/zfs_exporter.yml
warning

10.2.2.1. ZFS pool out of space

ZFS pool {{ $labels.pool }} is almost full (< 10% left).

- alert: ZFSPoolOutOfSpace
  expr: zfs_pool_free_bytes * 100 / zfs_pool_size_bytes < 10 and zfs_pool_readonly == 0 and zfs_pool_size_bytes > 0
  for: 0m
  labels:
    severity: warning
  annotations:
    summary: ZFS pool out of space (instance {{ $labels.instance }})
    description: "ZFS pool {{ $labels.pool }} is almost full (< 10% left).\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
critical

10.2.2.2. ZFS pool unhealthy

ZFS pool state is {{ $value }}. See comments for more information.

  # 0: ONLINE
  # 1: DEGRADED
  # 2: FAULTED
  # 3: OFFLINE
  # 4: UNAVAIL
  # 5: REMOVED
  # 6: SUSPENDED
- alert: ZFSPoolUnhealthy
  expr: zfs_pool_health > 0
  for: 0m
  labels:
    severity: critical
  annotations:
    summary: ZFS pool unhealthy (instance {{ $labels.instance }})
    description: "ZFS pool state is {{ $value }}. See comments for more information.\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

10.2.2.3. ZFS collector failed

ZFS collector for {{ $labels.instance }} has failed to collect information

- alert: ZFSCollectorFailed
  expr: zfs_scrape_collector_success != 1
  for: 0m
  labels:
    severity: warning
  annotations:
    summary: ZFS collector failed (instance {{ $labels.instance }})
    description: "ZFS collector for {{ $labels.instance }} has failed to collect information\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"