How openwisp/openwisp-monitoring works
Main Components
a. User Interface Layer:
• Django Admin, dashboard templates, and static assets (JS, CSS, images).
• Client-side monitoring charts, maps, and configuration screens.
b. API Layer:
• REST endpoints provided under “device/api” and “monitoring/api” for external integrations.
c. Application / Business Logic Layer:
• The “check” module: Contains classes (ping, iperf3, wifi_clients, etc.) that manage network checks, scheduling (via management commands and tasks), and alerting.
• The “device” module: Manages network devices, including configuration, health status, and device-specific checks.
• The “monitoring” module: Coordinates overall monitoring logic, configurations, metrics aggregation, and visualization.
d. Data Storage:
• The Django relational database (PostgreSQL, MySQL, etc.) to persist models and configurations.
• The InfluxDB backend under “db/backends/influxdb”: Handles time-series data storage for metrics.
e. Deployment and Integration Components:
• Docker and docker-compose files indicating containerized deployment.
• CI/CD configurations under “.github/workflows” to automate testing and deployment.
Relationships and Interactions
• Within the core business layer, show interactions between the check, device, and monitoring apps. For instance, the check service executes network tests and generates metrics that the monitoring module aggregates and presents.
• Communication between the business logic layer and the data storage components:
Architectural Patterns and Principles
• Modular structure inherent in Django projects. Each Django “app” (check, device, monitoring) is relatively self-contained, yet they interact to form the full monitoring solution.
• That the project follows a separation of concerns – the UI layer (templates/static files) is distinct from the business logic (services, management commands, task scheduling) and data access layers (ORM and InfluxDB clients).
• For scheduling and check execution, show that management commands (e.g., run_checks) and asynchronous tasks are part of the application’s workflow.
Relevant Technologies
• Python and Django as the core framework.
• InfluxDB as the time-series database (via the custom backend in “db/backends/influxdb”).
• Docker (Dockerfile, docker-compose) for deployment and containerization.
• Various front-end libraries and utilities for dashboard rendering (visible in the device and monitoring static directories).