26 lines
931 B
Markdown
26 lines
931 B
Markdown
# ADR-005: Device Status Calculation
|
|
|
|
## Status
|
|
Accepted
|
|
|
|
## Context
|
|
Devices report heartbeats at regular intervals. We need to determine online/offline status.
|
|
|
|
## Decision
|
|
- Agent sends heartbeats every 30 seconds (configurable)
|
|
- Server marks device as `online` on each received heartbeat
|
|
- A background worker checks for stale devices every 60 seconds
|
|
- If last heartbeat is older than 2 minutes, device is marked `offline`
|
|
- If metrics show concerning values (disk > 90%), device is marked `warning`
|
|
|
|
## Rationale
|
|
- Simple threshold-based status is reliable and easy to understand
|
|
- Status transitions are logged for audit purposes
|
|
- The threshold is configurable per-device or globally
|
|
- Future: more sophisticated health scoring
|
|
|
|
## Consequences
|
|
- Status is computed server-side, not trusted from the agent
|
|
- The heartbeat interval affects status responsiveness
|
|
- Status changes generate audit events and can trigger alerts
|