Commit Graph

14 Commits

Author SHA1 Message Date
0f829e0380 Split into dedicated hardware poller + read-only consumers
Rearchitect so a single poller process is the sole owner of all SAS/SMART/
SES hardware I/O, serialized behind one gate and paced, writing results to
Redis. The API/web and MQTT publisher become pure Redis readers — they no
longer issue any subprocess and can restart freely without touching the bus.

This addresses backplane/expander stress from concurrent + restart-triggered
SMART/SES storms (the prior model re-ran a hardware sweep on every container
start, and polled sg_ses 0x02+0x07 every 60s; 0x07 errored on the IOM6/
Xyratex expanders).

- poller.py: paced sweep (inventory, SMART per-drive w/ gap, SES 0x02, ZFS,
  host/MegaRAID), startup jitter, single-instance Redis lock, LED-queue worker
- services/hwgate.py: global serialization semaphore (POLL_CONCURRENCY=1)
- services/store.py: Redis as the only producer<->consumer interface + LED queue
- services/health.py: shared drive-health classifier (fixes overview double-count)
- gate smartctl/sg_ses/zpool/ledctl; drop sg_ses 0x07 from the hot path
- routers + temps read-only from the store; main.py drops the in-process poller
- compose: 3 services (privileged poller + unprivileged app + redis) w/ pacing knobs
2026-06-16 15:12:34 +00:00
d41e3838d5 Add per-enclosure temperature metrics + Home Assistant MQTT publisher
- enclosure: fetch SES element descriptor page (0x07) and label temp/fan/
  psu/voltage elements with human-readable names
- temps service + /api/temps: per-enclosure hotspot (max across SES sensors
  and housed drive temps) plus named SES sensor list
- mqtt_publisher: paho-mqtt with HA discovery (device per enclosure, hotspot
  + per-sensor entities), LWT availability, opt-in via MQTT_HOST
- secrets: OpenBao KV v2 reader; MQTT creds sourced from secret/home_assistant
  with env fallback
- compose/requirements/README updated
2026-06-16 04:45:32 +00:00
1b7412c80d Fix UnboundLocalError when no enclosures present 2026-03-07 23:02:34 +00:00
b11c1bdf98 Replace in-memory TTL cache with Redis 2026-03-07 18:45:15 +00:00
0112875894 Add enclosure health details (PSUs, fans, temps, voltages) via SES
Parse sg_ses --page=0x02 output to surface enclosure-level health data
including power supply status, fan RPMs, temperature sensors, and voltage
rails. Failed/critical components are reflected in the overview totals
and shown as status pills in the enclosure card header with an expandable
detail panel.
2026-03-07 06:03:26 +00:00
1dd40a1181 Enumerate physical drives behind RAID via smartctl megaraid passthrough 2026-03-07 05:32:08 +00:00
798308d2bf Add host drives section for non-enclosure drives 2026-03-07 05:16:30 +00:00
927a5ccf3a Add ledctl locate/off LED controls to drive detail modal 2026-03-07 04:57:35 +00:00
a25ce4ae21 Add ZFS drive state (ONLINE/FAULTED/DEGRADED) to UI 2026-03-07 04:44:31 +00:00
3ef7061aa5 Add ZFS vdev exposure in API and frontend 2026-03-07 04:14:14 +00:00
861f9279c4 Implement full JBOD monitor frontend from design JSX
- Dark/light theme toggle, grid/table view toggle
- Expanded DriveHealthSummary with wwn, firmware, capacity, SMART
  counters, and computed health_status field
- Drive detail modal with identity, WWN, ZFS membership, SMART health
- 30s auto-refresh
2026-03-07 03:41:35 +00:00
7beead8cae Add React frontend, ZFS pool mapping, and multi-stage Docker build
- Vite + React frontend with dark-themed dashboard, slot grid per
  enclosure, and SMART detail overlay
- ZFS pool membership via zpool status -P
- Multi-stage Dockerfile (Node build + Python runtime)
- Updated docker-compose with network_mode host and healthcheck
2026-03-07 03:04:23 +00:00
1157a5284f Add .gitignore and remove cached pyc files 2026-03-07 02:14:44 +00:00
9f918a3308 Initial commit: FastAPI JBOD monitor backend 2026-03-07 02:14:17 +00:00