endpoint_health_score
Calculate a composite health score (0-100) for each endpoint by deducting points for offline, stale, patch-behind, and agent-behind signals. Returns worst-first rankings with deduction reasons.
Instructions
[READ] Composite per-endpoint health score (0-100), worst endpoints first.
Answers "which endpoints are worst?" by folding the fleet signals into one ranked view: it deducts points for each risk signal (offline, stale, patch-behind, agent-behind) and cites every deduction in the endpoint's 'reasons'. Pure analysis over injected inventory rows (the shape from endpoint_list) — no live connection is used. With no baseline, the patch and agent baselines are derived by fleet majority, so it works before a gold image is declared.
Args: endpoints: Injected inventory rows (id, hostname, online, lastSeenHours, agentVersion, patchLevel) to score. Required — no live pull. stale_hours: An endpoint whose lastSeenHours >= this is 'stale' (default 24). baseline: Intended {'agentVersion', 'patchLevel'}; omit to derive the fleet majority.
Returns dict: {endpointsEvaluated, baseline:{agentVersion, patchLevel, source}, summary:{healthy, degraded, critical}, worst:[{endpoint, score, band, reasons[]} ...worst-first], note}.
Example: endpoint_health_score(endpoints=[ {"hostname":"tc01","online":True,"agentVersion":"12.6","patchLevel":"2026-06"}, {"hostname":"tc02","online":False,"agentVersion":"12.5","patchLevel":"2026-05"}]).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| baseline | No | ||
| endpoints | Yes | ||
| stale_hours | No |