Alert & Threshold System

How Threshold Monitoring Works

An explanation of the threshold configuration system, how alerts are generated, and the alert lifecycle (active → acknowledged → resolved).


Overview

Five modules in IFSNP — Rainfall, Temperature, Economy, Currency, and Displacement — implement an automated threshold monitoring system that generates alerts when indicator values exceed configured thresholds.

How It Works

  1. Configure thresholds — In the admin panel, set a threshold for a specific indicator, country, and data type (e.g., "Alert when weekly rainfall anomaly exceeds +50mm in Ethiopia").
  2. Run the check command — A management command (e.g., check_rainfall_thresholds) scans recent data against all active thresholds.
  3. Alert created — If a threshold is breached, an Alert record is created in the database with status active.
  4. Notification sent — Configured notification recipients (email or other channels) receive a notification about the alert.
  5. Alert lifecycle — An active alert can be:
    • Acknowledged — A user confirms they have seen it.
    • Resolved — The situation is resolved.
    • Dismissed — The alert is a false positive and is dismissed.

Alert Dashboard

Each module with threshold monitoring has an Alerts link on its main page. The dashboard shows all active alerts for that module with their severity, date, and affected area.

Threshold Configuration

Access threshold configurations through the Django admin panel under the relevant app (e.g., Rainfall → Threshold Configurations).

Sample Thresholds

Run the following commands to seed example threshold configurations:

python manage.py setup_sample_thresholds                  # Rainfall
python manage.py setup_sample_temperature_thresholds      # Temperature
python manage.py setup_sample_economy_thresholds          # Economy
python manage.py setup_sample_currency_thresholds         # Currency
python manage.py setup_sample_displacement_thresholds     # Displacement