No description
Find a file
Graham McIntire d431db37bb
What Was Built
Monitoring Infrastructure:
  - lib/towerops/monitoring/ping.ex - OS-agnostic ping functionality that works on macOS, Linux, and Windows
  - lib/towerops/monitoring/equipment_monitor.ex - GenServer that monitors individual equipment at configurable intervals
  - lib/towerops/monitoring/supervisor.ex - DynamicSupervisor with Registry for managing monitor workers
  - lib/towerops/monitoring.ex - Context for creating and querying monitoring checks

  Database:
  - monitoring_checks table stores historical ping results with status, response time, and timestamps
  - Indexed on (equipment_id, checked_at) for efficient querying

  Real-Time Updates:
  - PubSub broadcasting on equipment:#{id} topic when status changes
  - Equipment show page subscribes to updates and refreshes automatically
  - Manual "Check Now" button to trigger immediate checks

  Application Integration:
  - Monitoring.Supervisor added to application supervision tree
  - All monitored equipment starts monitoring automatically on app startup
  - Recent checks displayed in Equipment show page

  How It Works

  1. On application start, a monitor GenServer is spawned for each equipment with monitoring_enabled: true
  2. Each monitor pings its equipment at the configured interval (default 5 minutes)
  3. Results are saved to monitoring_checks table
  4. Equipment status is updated if it changes (up ↔ down)
  5. Status changes are broadcast via PubSub to all connected LiveViews
  6. The Equipment show page updates in real-time when status changes
2025-12-21 16:52:23 -06:00
assets init 2025-12-21 11:10:43 -06:00
config 1. User Authentication 2025-12-21 13:31:59 -06:00
lib What Was Built 2025-12-21 16:52:23 -06:00
priv What Was Built 2025-12-21 16:52:23 -06:00
test 1. User Authentication 2025-12-21 13:31:59 -06:00
.formatter.exs format 2025-12-21 11:31:08 -06:00
.gitignore init 2025-12-21 11:10:43 -06:00
AGENTS.md 1. User Authentication 2025-12-21 13:31:59 -06:00
IMPLEMENTATION_PLAN.md What Was Built 2025-12-21 16:52:23 -06:00
mix.exs 1. User Authentication 2025-12-21 13:31:59 -06:00
mix.lock 1. User Authentication 2025-12-21 13:31:59 -06:00
README.md init 2025-12-21 11:10:43 -06:00

Towerops

To start your Phoenix server:

  • Run mix setup to install and setup dependencies
  • Start Phoenix endpoint with mix phx.server or inside IEx with iex -S mix phx.server

Now you can visit localhost:4000 from your browser.

Ready to run in production? Please check our deployment guides.

Learn more