services:
  jellyfin:
    depends_on:
      - tdarr
      - cpu
    impact:
      - media
      - nextcloud

  nextcloud:
    depends_on:
      - database
      - redis

rules:
  - id: cpu_ram_pressure
    description: CPU élevé + mémoire sous pression
    when:
      cpu:
        gt: 80
        for: 5m
      memory_available:
        lt: 15
    impact: "Risque fort de ralentissement général"
    severity: high

  - id: io_wait_saturation
    description: IO wait élevé
    when:
      io_wait:
        gt: 20
        for: 3m
    impact: "Disque saturé, latences applicatives"
    severity: high
