Wireless Monitor — Architecture & Technical Reference
Wireless Monitor — Architecture & Technical Reference
Versión: v1.0.27 (05-03-2026)
Ruta: /monitoring/wireless/
Estado: v3 — Configurable chart grid, multi-radio, reports, real-time WS
Objetivo
Página dedicada para monitoreo de Access Points WiFi, separada de Observatory. Observatory está optimizado para dispositivos de red genéricos (switches, routers, firewalls) con ping/SNMP/HTTP. Wireless Monitor agrega datos específicos de WiFi: radios, SSIDs, clientes conectados, señal, y métricas vendor-specific.
Arquitectura
Principio: Reutilización máxima
No se creó ningún modelo ni app nueva. La página reutiliza 100% de la infraestructura existente:
| Componente | Reutilización |
|---|---|
DeviceProfile (network app) | Modelo existente — filtrado por device_type='access_point' |
deep_snmp_data (JSONField) | Datos de Deep Discovery ya almacenados |
VendorProfile + Registry | OIDs vendor-specific ya configurados |
MonitoringTarget + VictoriaMetrics | Time-series para charts (extras, snmp, fast_snmp) |
DeviceFilterService.js | 100% reutilizado (search, status, group, rack) |
SidebarResize.js | 100% reutilizado (drag handle, localStorage) |
ApiService.js | 100% reutilizado (CSRF, error handling) |
| ECharts | Configurable chart grid con 4 chart types |
| MonitoringConsumer (WebSocket) | WS push para metrics real-time |
| Auto-Provision deep-discover API | 100% reutilizado (botón Refresh Data) |
Layout
Sigue el patrón Observatory: sidebar izquierdo + workspace con sistema de pestañas.
+-------------------+--------------------------------------------------+
| SIDEBAR | WORKSPACE |
| | [Dashboard] [AP-1] [AP-2] [×] ← Tabs |
| CreaRack-Pro | |
| Wireless monitor | +---+ +---+ +---+ +---+ |
| | |119| |107| |2.2k| |Top| ← Summary Cards |
| Access Points 119 | +---+ +---+ +---+ +---+ |
| [Search...] | |
| [Status ▼] | ┌─AP Table (sortable)─────────────────────────┐ |
| [Group ▼][Rack ▼] | │ ● │ Name │ IP │ Vendor │ R │ Cl │FW │ |
| | │ ● │ AP-1 │ .42 │ Xirrus │ 8 │ 49 │8.5 │ |
| ● AP-1 (49 cl) | │ ○ │ AP-2 │ .55 │ Cambium│ 3 │ 0 │6.6 │ |
| ○ AP-2 (0 cl) | └─────────────────────────────────────────────┘ |
| ● AP-3 (15 cl) | |
| | == AP DETAIL TAB ============================== |
| | [Hardware: model, FW, serial, uptime, MAC] |
| [Report] | Charts [1h][4h][12h][24h] [Add Chart] |
| [Fleet Report] | ┌──────────────┐ ┌──────────────┐ |
| [Refresh All] | │Station Count?│ │AP Bandwidth ?│ |
| | │ ~~~~~~~~~~~~ │ │ ~~~~~~~~~~~~ │ |
| | └──────────────┘ └──────────────┘ |
| | ┌──────────────┐ ┌──────────────┐ |
| | │Ch Util ? │ │Noise Floor ? │ |
| | │ ≈≈≈≈≈≈≈≈≈≈≈ │ │ ≈≈≈≈≈≈≈≈≈≈≈ │ |
| | └──────────────┘ └──────────────┘ |
| | [Radio Table] [SSID Table] [Client Table] |
+-------------------+--------------------------------------------------+
Evolución
| Versión | Fecha | Características |
|---|---|---|
| v1 | 20-02-2026 | Base: sidebar, tabs, hardware info, dual charts (Station Count + Bandwidth), tables |
| v2 | 04-03-2026 | WebSocket real-time bandwidth, auto deep discovery, heatmap batch |
| v3 | 05-03-2026 | Configurable chart grid, multi-radio, reports, time pills, info tooltips, print theme |
Configurable Chart Grid (v3)
Módulos
| Módulo | Líneas | Responsabilidad |
|---|---|---|
WirelessChartRegistry.js | ~110 | Static registry: 9 métricas con chart type, data source, colors, tooltips, axis config, info text |
WirelessChartGrid.js | ~160 | Grid container: add/remove panels, time pills, WS distribution, timer refresh, layout persistence |
WirelessChartPanel.js | ~500 | Individual panel: metric selector, ECharts init, data loading, real-time append, loading overlay |
WirelessReport.js | ~475 | Reports: AP report (stats + charts + deep data + CSV), Fleet report, print with light theme |
Métricas disponibles (9)
| Key | Label | Chart Type | Source | Multi-radio |
|---|---|---|---|---|
station_count | Station Count | area | extras | No |
throughput | AP Bandwidth | dual-area | snmp | No |
channel_utilization | Channel Utilization | multi-area | extras | Yes (×8) |
noise_floor | Noise Floor | multi-area | extras | Yes (×8) |
avg_data_rate | Avg Data Rate | multi-area | extras | Yes (×8) |
snr | SNR | multi-area | extras | Yes (×8) |
channel | Channel | step | extras | No |
tx_power | TX Power | area | extras | No |
clients_per_radio | Clients / Radio | area | extras | No |
Chart Types
- area: Single line with gradient fill (Station Count, TX Power, Clients/Radio)
- dual-area: Two lines with legend — Inbound (green) + Outbound (blue) for bandwidth
- multi-area: Up to 8 lines, one per radio — 8-color palette (red, orange, yellow, green, cyan, blue, violet, pink)
- step: Step function for discrete values (Channel)
Features
- Add/Remove panels: Max 8 per AP, “Add Chart” button picks next unused metric
- Metric selector: Dropdown per panel to switch metric on the fly
- Time range pills:
1h | 4h | 12h | 24h— click reloads all panels with selected range - Info tooltips:
?button per panel with descriptive text fromCHART_REGISTRY[key].info - Layout persistence:
localStoragekeywireless_chart_layout_v3_{profileId}— saved on add/remove/switch - Default layout:
['station_count', 'throughput', 'channel_utilization', 'noise_floor'] - Loading overlay: “Loading…” → “Waiting for data…” if no data returned
- Available metrics filtering: Only metrics with matching OIDs in vendor’s
monitoring_oidsare shown - Accent border:
border-top: 2px solid var(--accent)on each panel
Multi-Radio Detection
Per-radio metrics (Channel Util, Noise Floor, etc.) use OID keys suffixed _1 through _8 (e.g., channel_utilization_1, channel_utilization_2). The available-metrics logic in WirelessDetail.js collapses these per-radio keys to their base key (e.g., channel_utilization) so the metric appears once in the selector, not 8 times.
VendorProfile.monitoring_oids:
channel_utilization_1: ".1.3.6..."
channel_utilization_2: ".1.3.6..."
...
channel_utilization_8: ".1.3.6..."
→ Available metrics: ["channel_utilization"] (collapsed)
→ Registry lookup: CHART_REGISTRY.channel_utilization.metricKeys = ["channel_utilization_1", ..., "channel_utilization_8"]
→ Chart: 1 line per radio that has data
WebSocket Real-Time (v2)
Data flow
Agent (Sentinel fast_snmp_loop, 15s)
→ WebSocket push to SaaS (MonitoringConsumer)
→ Forward to browser WS subscribers
→ WirelessChartGrid.handleRealtimeMetric()
→ Each panel checks if WS key matches its metricKeys
→ Appends data point to ECharts series
Metric key matching
- WS key arrives as
snmp_fast_channel_utilization_1orsnmp_extras_noise_floor_3 - Panel strips prefix:
snmp_fast_orsnmp_extras_→channel_utilization_1 - Matches against
config.metricKeysarray to find series index
Green dot indicator
When a chart grid receives real-time WS data, the .chart-grid-label shows a pulsing green dot (CSS ::after pseudo-element via .ws-realtime-active class).
Auto Deep Discovery
- On tab open: Deep discovery triggers immediately when opening an AP detail tab
- Periodic refresh: Every 5 minutes for open AP tabs
- Status polling: Polls
/profiles/{id}/deep-discover-statusinstead of fixed timeout - Data table refresh: Radio/SSID/Client tables refresh from latest
deep_snmp_data - REST fallback: When Agent WS disconnected, browser sends tasks directly to Agent via
POST localhost:5050/network/deep-discover
Reports (v3)
AP Report
Generated via GET /api/monitoring/wireless/report/{profileId}?hours=24:
- Header: AP name, IP, vendor, model, firmware
- Time range pills: 1h, 4h, 12h, 24h, 7d — re-generates report
- Stats cards: Avg/Min/Max/P95 for Station Count, Bandwidth In/Out, Noise Floor, TX Power, Channel, Clients/Radio
- Charts: Up to 7 static ECharts (no animation) for available metrics
- Deep data tables: Hardware, Radios (pivot), SSIDs (pivot), Clients (pivot, max 50)
- Export CSV: Client-side generation with timestamped filename
- Print: Light theme for ECharts axes + CSS
@media printfor dark text/white background
Fleet Report
Generated via GET /api/monitoring/wireless/fleet-report?hours=24:
- Summary cards: Total APs, Online, Offline, Total Clients
- AP table: Name, IP, Status, Clients, Vendor, Model, Firmware
- Export CSV + Print
Print Light Theme
_print() switches ECharts axis colors before window.print():
- xAxis label:
rgba(255,255,255,0.5)→#666 - xAxis line:
rgba(255,255,255,0.15)→#ccc - yAxis label:
rgba(255,255,255,0.5)→#666 - yAxis splitLine:
rgba(255,255,255,0.06)→#e5e5e5
CSS @media print handles text colors, table styling, break-inside: avoid.
Fuentes de datos
1. DeviceProfile.deep_snmp_data (JSONField)
Estructura con categorías separadas por tipo de dato:
{
"hardware": [
{"name": "hostname", "index": "0", "value": "AP-01", "oid": "..."},
{"name": "model", "index": "0", "value": "XR4836", "oid": "..."},
{"name": "firmwareVersion", "index": "0", "value": "8.5.11", "oid": "..."}
],
"wireless": [
{"name": "radioName", "index": "1", "value": "iap1", "oid": "..."},
{"name": "radioBand", "index": "0", "value": "2.4GHz", "oid": "..."},
{"name": "associatedClients", "index": "1", "value": "12", "oid": "..."}
],
"ssids": [
{"name": "ssidName", "index": "0", "value": "Corporate", "oid": "..."},
{"name": "ssidVlan", "index": "0", "value": "100", "oid": "..."}
],
"clients": [
{"name": "clientMac", "index": "0", "value": "AA:BB:CC:...", "oid": "..."},
{"name": "clientSignal", "index": "0", "value": "-65", "oid": "..."}
]
}
2. VictoriaMetrics (time-series)
| Endpoint | Data | Used by |
|---|---|---|
GET /targets/{id}/vm/extras?hours=N | Per-radio metrics (channel_util, noise, SNR, etc.) + station_count | Chart panels (area, multi-area) |
GET /targets/{id}/vm/snmp?hours=N | Bandwidth in/out Mbps (from Agent Sentinel, polled at config.snmp_interface ifIndex) | Chart panels (dual-area) |
GET /monitoring/wireless/report/{id}?hours=N | Aggregated stats + all time-series | Reports |
GET /monitoring/wireless/fleet-report?hours=N | Fleet summary | Fleet report |
GET /monitoring/availability-heatmap | Batch availability for dashboard heatmap |
3. WebSocket (real-time)
| WS key pattern | Example | Panel match |
|---|---|---|
snmp_fast_* | snmp_fast_channel_utilization_1 | multi-area panels |
snmp_extras_* | snmp_extras_noise_floor_3 | multi-area panels |
snmp_bandwidth_in_mbps | — | dual-area (throughput) |
snmp_bandwidth_out_mbps | — | dual-area (throughput) |
4. Campos OID por vendor
| Campo | Cambium | Xirrus |
|---|---|---|
| Radio | radioBand, radioChannel, radioTxPower, noiseFloor, radioStatus, clientsPerRadio | radioName, radioMac, associatedClients, interfaceSpeed |
| SSID | ssidName, ssidVlan, ssidSecurity, ssidActiveClients | ssidName, ssidVlan, ssidSecurity |
| Client | clientMac, clientIp, clientSignal, clientSsid, clientHostname, clientVendor, clientPhyMode, clientSessionTime | stationMac |
| Hardware | hostname, model, firmwareVersion, serialNumber, macAddress, location, numRadios, uptimeSeconds | cdpHostname, cdpModel, cdpFirmware, location |
5. Status determination
Si tiene MonitoringTarget → usar last_status (up→online, down→offline)
Si NO tiene MT pero last_verified < 2h → online (respondió a SNMP)
Si NO tiene MT pero tiene deep_snmp_data antiguo → offline
Si no tiene nada → unknown (gris)
Actualización v1.85.2 (ciclos 5 y 6 de la auditoría #261, 25-08-2026): se añadió WirelessLive (monitoring/api/wireless.py) como señal adicional — una consulta instantánea a VictoriaMetrics por petición sobre snmp_fast_station_count/snmp_extras_connected_clients (ventana 2×cadencia + margen). Un AP con SNMP fresco cuenta online aunque el ping falle (en el CCIB, donde la red filtra ICMP, esto afectaba a 47 APs), y sus clientes salen del dato vivo en vez de la foto del deep discovery, que pasa a ser solo respaldo. Mismo criterio aplicado también a /wireless/deep-data (antes tenía su propio cálculo sin frescura). Detalle completo en [[feature—wireless—clientes-vivos-ahora]].
Actualización v1.164.5 (28-09-2026, visto en PROD durante FABCON26): la agregación de SSIDs de get_wireless_group_summary (tabla de la ficha de un grupo) suma un segundo filtro además del de arriba — que el AP esté vivo no basta, la FOTO del deep discovery (deep_snmp_updated_at) también tiene que ser reciente (SSID_PHOTO_MAX_AGE, 60 min). Sin este filtro, un AP vivo con una foto de semanas atrás colaba en la tabla redes de eventos ya terminados. Detalle completo, con el contrato de la respuesta y los campos nuevos, en [[feature—wireless—clientes-vivos-ahora]].
Archivos
Backend
| Archivo | Descripción |
|---|---|
monitoring/views.py | wireless_view: query DeviceProfile, conteo radios/clientes, status con fallback |
monitoring/api.py | GET /wireless/summary, GET /wireless/report/{id}, GET /wireless/fleet-report |
monitoring/urls.py | path('wireless/', ...) |
Frontend
| Archivo | Líneas | Descripción |
|---|---|---|
templates/monitoring/wireless.html | ~195 | Template: sidebar + tabs + dashboard cards + tabla AP |
static/js/pages/wireless.js | ~700 | Coordinador: init, tabs, filtros, sort, WS, auto-refresh |
static/js/pages/wireless/WirelessDashboard.js | ~97 | Summary cards + tabla AP sortable + heatmap |
static/js/pages/wireless/WirelessDetail.js | ~850 | Detail: hardware info, chart grid, deep data tables, WS subscriptions |
static/js/pages/wireless/WirelessChartGrid.js | ~160 | Chart grid: panels, time pills, WS distribution, layout persistence |
static/js/pages/wireless/WirelessChartPanel.js | ~500 | Chart panel: metric selector, ECharts, data loading, real-time append |
static/js/pages/wireless/WirelessChartRegistry.js | ~110 | Static registry: 9 metrics with config (type, source, colors, info) |
static/js/pages/wireless/WirelessReport.js | ~475 | Reports: AP + Fleet, stats cards, charts, deep tables, CSV, print |
static/css/pages/wireless.css | ~1,300 | Layout, sidebar, tabs, cards, tables, chart grid, report modal, print styles |
Integration
| Archivo | Cambio |
|---|---|
templates/base.html | Link “Wireless” en navbar |
templates/terminal/index.html | Botón “Send to Wireless” en Auto-Provision Step 3 |
static/js/network/auto_provision.js | sendToWireless() + conteo split APs/switches |
Sistema de pestañas
Replica el patrón de Observatory:
- Dashboard tab (siempre presente, no cerrable): summary cards + tabla AP + heatmap widget
- AP tabs (dinámicas): click en sidebar/tabla → abre pestaña con detalle
- Persistencia:
localStoragekeywireless_tabs_v2guarda tabs abiertas y tab activa - Cleanup: al cerrar tab, se destruye WirelessChartGrid (dispone todos los ECharts)
- Auto deep discovery: trigger al abrir tab + refresh cada 5 min
Multi-vendor rendering
WirelessDetail.js detecta automáticamente el vendor por los campos presentes:
- Si existe
radioBand→ estilo Cambium (Band, Channel, TxPower, Noise, Status, Clients) - Si existe
radioName→ estilo Xirrus (Name, MAC, Clients, Speed) - Columnas de tabla se adaptan dinámicamente (no se muestran columnas vacías)
- Client table: si hay 8 campos (Cambium) muestra tabla completa; si solo MAC (Xirrus) muestra lo disponible
- Signal con color-coding: verde >-60dBm, azul >-70, amarillo >-80, rojo <-80
- Security decode: Xirrus usa códigos numéricos (3=WPA2), Cambium usa texto
- Session time formateado: segundos → “2h 15m”
Auto-Provision integration
“Send to Wireless” (Step 3)
- Filtra perfiles seleccionados por
device_type === 'access_point' - Muestra conteo separado: “X Switches/Routers” + “Y Access Points”
- Toast de confirmación + redirección a
/monitoring/wireless/ - Los APs enviados ya tienen
deep_snmp_datasi Deep Discovery estaba activo
API Endpoints
| Método | Ruta | Descripción |
|---|---|---|
| GET | /monitoring/wireless/ | Página Wireless Monitor (view Django) |
| GET | /api/monitoring/wireless/summary | Stats agregadas: total, online, offline, clients, busiest |
| GET | /api/monitoring/wireless/group-summary/{group_id} | Stats agregadas de un grupo: online, offline, clients, SSIDs (con filtro de frescura — ver v1.164.5 arriba) |
| GET | /api/monitoring/wireless/report/{profileId} | AP report: stats + metrics + deep_data |
| GET | /api/monitoring/wireless/fleet-report | Fleet report: all APs summary + table |
| GET | /api/monitoring/availability-heatmap | Batch availability for dashboard heatmap |
| GET | /api/network/auto-provision/profiles/{id} | Perfil con deep_snmp_data |
| POST | /api/network/auto-provision/profiles/{id}/deep-discover | Refresh deep SNMP data |
| GET | /api/monitoring/targets/{id}/vm/extras | Time-series per-radio metrics |
| GET | /api/monitoring/targets/{id}/vm/snmp | Time-series bandwidth |
Roadmap (v4)
- Mapa de cobertura WiFi (APs posicionados en plano con círculos de señal)
- Alertas WiFi: AP con 0 clientes, canal solapado, señal degradada
- SNMPv3 polling para entornos de producción
Última actualización: 28-09-2026 Mantenido por: Claude (Anthropic) + Equipo CreaRack
Véase también
- [[crearack-tech—backend—network-observatory]]
- [[crearack-tech—backend—multi-vendor-snmp-guide]]
- [[crearack-tech—backend—network-tools]]
- [[crearack—monitoring—configurar-snmp]]
- [[crearack—redes-infra—monitorizacion]]
- [[feature—wireless—clientes-vivos-ahora]]