Health index
The health index sums up the infrastructure in one 0–100 number, for the whole estate or for an environment, a team or a business service. It combines four pillars (availability, security, hygiene, coverage) and explains every point it loses, with a link to the filtered view.
Overview
The index is computed live on every request from data the platform already has: business service health and uptime, security findings (priority, KEV, SLA), end-of-life findings, reboots, certificates, agent versions and coverage. Each pillar is a score from 0 to 100; the index is the weighted mean of the pillars that have data. A pillar without data is excluded and the weights of the others are renormalised, and it shows "Data not available" with the reason: the index is never 100 because data is missing. When no pillar has data the index is null.
Where it appears
The index is the first tile of the Dashboard (/dashboard): score, 7-day delta, 30-day sparkline (with "View as table") and the four pillars; click a pillar to see the contributions that lost points and the signals without data. The environment or team filter of the Dashboard selects the scope; the service scope is available through the API.

Scopes
The scope selects the assets and business services counted:
- global: every active asset and every active business service
- environment: active assets of the environment; active services with at least one direct member among them or assigned to the environment
- team: active assets whose team is the team (team_ref); active services with a direct member among them or owned by the team
- service: the active service alone, with its direct and derived members
Signals
Security, hygiene and coverage are built from signals. A signal is the share of items affected by a problem: share = min(1, affected / total), with a weight. The security signals and eol count assets, not findings: a host with 50 P1 findings weighs as much as a host with one. Their denominator N is the number of compute assets of the scope (asset_type in COVERAGE_COMPUTE_ASSET_TYPES). The other hygiene signals and the coverage signals have their own totals, listed with each signal below (certificates, for example, counts ssl_expiry checks, not assets). A pillar score is 100 − 100 × Σ(weight × share) / Σweight over the available signals, and the points lost by a signal are 100 × weight × share / Σweight. A signal whose upstream data is missing is listed as unavailable with its reason and left out of the pillar; a pillar with no available signal is excluded from the index.
Availability
For every service of the scope with a computed health, the state score (healthy 100, degraded 50, critical 0; unknown is ignored) and the 7-day uptime are averaged. The uptime counts degraded time as up, so a service degraded all week scores (50 + 100) / 2 = 75. The pillar is the mean of the service scores weighted by tier with HEALTH_INDEX_TIER_WEIGHTS (default tier-1: 3, tier-2: 2, tier-3: 1); each service loses tier weight / Σweight × (100 − score) points. A tier-1 critical service with 50% uptime (score 25) and a tier-3 healthy one (100) give (3 × 25 + 1 × 100) / 4 = 43.75. Without services the pillar shows "no business service in scope"; with services but no computed health, "no service health computed yet".
Security
Open and acknowledged active findings of the scope assets (every asset type), counted as distinct assets over N. Weights in HEALTH_INDEX_SECURITY_WEIGHTS:
- p1 (40): assets with a P1 finding; unavailable when open findings exist but none has a priority yet
- p2 (20): assets with a P2 finding; same rule
- kev (25): assets with a CVE finding in the CISA KEV catalog; unavailable while the KEV catalog has never been synced
- sla_overdue (15): assets with a finding past its SLA due date; unavailable when open findings exist but none has a due date
Hygiene
Weights in HEALTH_INDEX_HYGIENE_WEIGHTS:
- reboot (25): compute assets whose agent reports reboot_required = true, over those reporting it
- eol (35): assets with an open end-of-life finding over N; unavailable while the endoflife.date feed has never been synced
- certificates (25): ssl_expiry checks degraded or critical (expiring within 30 days or expired), over every ssl_expiry check of the scope
- agents (15): agent hosts whose active agent runs a version below the reference, over those with a readable version. The reference is HEALTH_INDEX_AGENT_TARGET_VERSION, or the highest version among the active agents when it is empty. Versions are compared on their numeric prefix (v1.5.2, 1.10.0-rc1); versions like "dev" are left out
Coverage
From the coverage rows of the scope compute assets (see Blind spots): agent, monitoring, inventory and discovery, each with weight 25 and share = 1 − covered / total. Discovery counts only the assets where discovery freshness applies. Before the first coverage run the pillar shows "coverage has not been computed yet"; a scope without compute assets shows "no compute asset in scope".
Weights and settings
Pillar weights are HEALTH_INDEX_WEIGHTS (default availability 40, security 30, hygiene 15, coverage 15). HEALTH_INDEX_WEIGHTS, HEALTH_INDEX_SECURITY_WEIGHTS, HEALTH_INDEX_HYGIENE_WEIGHTS and HEALTH_INDEX_TIER_WEIGHTS are dicts in the Django settings merged over the defaults: a partial dict changes only its keys, and a non-numeric, boolean or negative value keeps the default of that key. HEALTH_INDEX_AGENT_TARGET_VERSION is read from the environment. Each pillar reports its configured weight and its effective_weight, the renormalised percentage among the pillars with data. With security 80, hygiene 100, coverage 50 and no services, the weights become 50/25/25 and the index is 77.5.
Contributions and links
Each pillar lists up to 5 contributions that lost points, largest first: points (on the pillar scale) and index_points = points × effective_weight / 100. Each contribution links to the filtered view: /dashboard/security?priority=P1, priority=P2, kev=true, sla=overdue, /dashboard/security?finding_type=eol, /dashboard/coverage?gap=<gap>, /dashboard/security/servers (reboot), /dashboard/monitoring (certificates), /dashboard/discovery/agents (agents) and /dashboard/services/<id> (availability). For an environment or team scope the security, EOL and coverage links add environment=<id> or team_ref=<id>; the findings queue reads environment, team_ref and finding_type from the URL and shows them as removable chips.
API
GET /api/v1/health-index/?scope=global|environment|team|service&id=<id> (any authenticated user). Without scope the global index is returned and id is ignored. An unknown scope, or a missing or non-positive id, returns 400; an environment, team or service that does not exist (or an inactive service) returns 404. The response has scope, id, name, computed_at, score, available, reason, pillars[] (availability, security, hygiene, coverage, each with key, label, available, score, weight, effective_weight, points_lost, reason, contributions[] and unavailable[]), delta_7d and reference_date.
{
"scope": "environment", "id": 3, "name": "prod",
"computed_at": "2026-11-29T10:00:00Z",
"score": 77.5, "available": true, "reason": "",
"pillars": [
{"key": "availability", "label": "Availability", "available": false, "score": null,
"weight": 40.0, "effective_weight": null, "points_lost": null,
"reason": "Data not available: no business service in scope", "contributions": [], "unavailable": []},
{"key": "security", "label": "Security", "available": true, "score": 80.0,
"weight": 30.0, "effective_weight": 50.0, "points_lost": 20.0, "reason": "",
"contributions": [
{"key": "p1", "label": "Assets with P1 findings", "affected": 2, "total": 10,
"points": 10.7, "index_points": 5.3, "link": "/dashboard/security?priority=P1&environment=3"},
{"key": "p2", "label": "Assets with P2 findings", "affected": 2, "total": 10,
"points": 5.3, "index_points": 2.6, "link": "/dashboard/security?priority=P2&environment=3"},
{"key": "sla_overdue", "label": "Assets with findings past their SLA", "affected": 2, "total": 10,
"points": 4.0, "index_points": 2.0, "link": "/dashboard/security?sla=overdue&environment=3"}],
"unavailable": [{"key": "kev", "label": "Assets with KEV findings", "reason": "the KEV catalog has never been synced"}]},
{"key": "hygiene", "label": "Hygiene", "available": true, "score": 100.0,
"weight": 15.0, "effective_weight": 25.0, "points_lost": 0.0, "reason": "", "contributions": [], "unavailable": []},
{"key": "coverage", "label": "Coverage", "available": true, "score": 50.0,
"weight": 15.0, "effective_weight": 25.0, "points_lost": 50.0, "reason": "",
"contributions": [
{"key": "agent", "label": "Compute assets without an active agent", "affected": 10, "total": 10,
"points": 25.0, "index_points": 6.2, "link": "/dashboard/coverage?gap=agent&environment=3"},
{"key": "monitoring", "label": "Compute assets without health checks", "affected": 10, "total": 10,
"points": 25.0, "index_points": 6.2, "link": "/dashboard/coverage?gap=monitoring&environment=3"}],
"unavailable": []}
],
"delta_7d": 5.0, "reference_date": "2026-11-22"
}Delta and nightly task
The Celery task compute_health_index_daily runs every night at 00:45 UTC (beat entry compute-health-index-daily) and stores one HealthIndexDailyStat row (score and the four pillar scores) for the global scope, every environment, every team and every active service, dated with the current UTC day. Running it again the same day updates the rows; a failing scope is logged and counted in errors while the others are saved. delta_7d is the live score minus the score stored for the UTC day 7 days ago (reference_date); it is null when that row is missing or either score is null. The rows follow HEALTH_HISTORY_RETENTION_DAYS (prune_old_records).
docker exec idp-backend python manage.py shell -c "from apps.monitoring.tasks import compute_health_index_daily; print(compute_health_index_daily())"