Monitoring 34 NTP Synchronized Clocks from a Cron Job
Description and use
A Python cron job monitors 34 NTP‑synchronized LED clocks, polling their HTTP status and alerting when offsets exceed ~1 s.
Problem
34 wall‑clock displays across three buildings were not being monitored for time accuracy, risking incorrect time display.
Outcome
All 34 displays are now monitored; alerts fire when a display’s offset exceeds ~1 s or when it becomes unreachable, preventing unnoticed drift.
Workflow
- 1. Verify upstream NTP server sanity with ntplib.
- 2. Define human‑perceivable offset threshold (~1 s).
- 3. Load fleet list from JSON.
- 4. Concurrently poll each device’s /status endpoint.
- 5. Normalize JSON response to internal schema.
- 6. Evaluate offset, last_sync_age, and online status.
- 7. Trigger alerts if offset > threshold or device offline.
- 8. Schedule script via cron for regular monitoring.
Evidence
Each unit exposes an HTTP status endpoint.
I initially monitored each display's offset from the NTP server and alerted at > 500 ms.
The shape I normalize to internally looks like this: {"id":"BLD-A-F2-REG-01",...}
- Record date: 2026-10-26T10:26:08.460Z