# Copyright (c) 2018-2022, diyIT.org
# All rights reserved.
#
# BSD 2-Clause License ("Simplified BSD License" or "FreeBSD License")
# https://diyit.org/license/
#
#

groups:
- name: Hardware alerts
  rules:
  - alert: Node_down
    expr: up{job="node_exporter"} == 0
    for: 1m
    labels:
      severity: warning
    annotations:
      summary: "Node {{ $labels.instance }} is down"
      description: "Failed to scrape {{ $labels.job }} on {{ $labels.instance }} for more than 1 minute. Node seems down."
  - alert: High_cpu_util
    expr: node_load1{job="node_exporter"} > 10
    for: 5m
    labels:
      severity: warning
    annotations:
      summary: "CPU {{ $labels.instance }} is high"
      description: "{{ $labels.job }} on {{ $labels.instance }} loaded more than 10 for more than 5 minutes."
  - alert: High_disk_util
    expr: gstat_percent_busy{job="gstat"} > 90
    for: 9m
    labels:
      severity: warning
    annotations:
      summary: "Disk {{ $labels.instance }} is loaded"
      description: "{{ $labels.job }} on {{ $labels.instance }} loaded more than 90% for more than 9 minutes."
- name: Probe alerts
  rules:
  - alert: Site_down
    expr: probe_success{job="web-diyit"} == 0
    for: 1m
    labels:
      severity: warning
    annotations:
      summary: "Site {{ $labels.instance }} is down"
      description: "Failed to scrape {{ $labels.job }} on {{ $labels.instance }} for more than 1 minute. Site seems down."
