How snowwiy/sentra works
Sentra monitors hosts through an agent-to-API-to-database workflow and presents their state in a polling web dashboard. The backend’s domain stages include enrollment and liveness, telemetry and inventory ingestion, change detection, event/metric alerting, and queryable asset views; retention and offline sweeps are supporting internal services. The README documents the broad architecture and API capabilities. Source excerpts are selective, so unsampled route-to-service and frontend-to-endpoint details are not asserted beyond documented relationships.
Main entry points: routes Versioned API routes · runner.py Agent runner · repositories Data access · sentra.ts Web API client
Components 25
Host agent
- Agent runner
agent/sentra_agent/runner.py - Host collection
agent/sentra_agent/collectors.py - Inventory scan
agent/sentra_agent/inventory.py - Event collection
agent/sentra_agent/events.py - API client
agent/sentra_agent/client.py
Sentra backend
- API application
backend/app/main.py - Versioned API routes
backend/app/api/v1/routes - Agent enrollment
backend/app/services/agent_service.py - Telemetry ingestion
backend/app/services/telemetry_service.py - Inventory changes
backend/app/services/inventory_service.py - Host events
backend/app/services/event_service.py - Alert rules
backend/app/services/alert_service.py - Asset views
backend/app/services/asset_service.py - Background jobs
backend/app/services/background.py - Data access
backend/app/repositories - Domain records
backend/app/models - Data retention
backend/app/services/retention_service.py
Web dashboard
- Dashboard pages
frontend/src/pages - Asset detail tabs
frontend/src/components/asset - Alert view
frontend/src/components/AlertsView.tsx - Web API client
frontend/src/api/sentra.ts - Refresh polling
frontend/src/lib/usePolling.ts
Other components
- Monitored host
- Operator browser
- PostgreSQL
Connections 28
- Monitored host → Agent runner: runs on
README.md - Agent runner → Host collection: collects metrics
agent/sentra_agent/runner.py - Agent runner → Inventory scan: collects inventory
agent/sentra_agent/runner.py - Agent runner → Event collection: collects events
agent/sentra_agent/runner.py - Agent runner → API client: sends reports
agent/sentra_agent/runner.py - API client → Versioned API routes: HTTP JSON
README.md - Operator browser → Dashboard pages: views
README.md - Dashboard pages → Web API client: requests data
frontend/src/pages/DashboardPage.tsx - Asset detail tabs → Web API client: requests asset data
README.md - Alert view → Web API client: requests alerts
frontend/src/components/AlertsView.tsx - Dashboard pages → Refresh polling: refreshes periodically
frontend/src/pages/DashboardPage.tsx - Web API client → Versioned API routes: calls API
README.md - API application → Versioned API routes: mounts routes
backend/app/main.py - Versioned API routes → Agent enrollment: handles registration
- Versioned API routes → Telemetry ingestion: ingests samples
- Versioned API routes → Inventory changes: ingests snapshots
- Versioned API routes → Host events: ingests events
- Versioned API routes → Alert rules: serves alerts
- Versioned API routes → Asset views: serves assets
- Agent enrollment → Data access: uses data access
backend/app/services/agent_service.py - Alert rules → Data access: queries and stores
backend/app/services/alert_service.py - Inventory changes → Data access: uses data access
backend/app/services/inventory_service.py - Data access → Domain records: queries ORM records
backend/app/repositories/alert_repository.py - Data access → PostgreSQL: persists records
README.md - API application → Background jobs: starts jobs
backend/app/main.py - Background jobs → Data retention: runs purge
backend/app/main.py - Background jobs → Alert rules: sweeps offline assets
- Data retention → PostgreSQL: purges old data
backend/app/services/retention_service.py