Commit graph

51 commits

Author SHA1 Message Date
5a3ede1f71 feat: config change → performance correlation system (Roadmap #2)
- New config_change_events table linking backup diffs to time windows
- ConfigChanges context with record/list functions and date filters
- Auto-detect changed sections from MikroTik config diffs
- Agent channel emits change events after backup creation
- Correlator engine: 2h before / 4h after QoE metric comparison
- Creates suspect_config_change insights on significant degradation
- Config Timeline LiveView with chart data, change list, detail view
- Device page: Config Timeline tab + Recent Config Changes card
- Dashboard: Recent Config Changes section with impact indicators
- Fix pre-existing integrations_live.html.heex scope bug
2026-02-13 17:56:55 -06:00
02f837ca5b
fix: replace em-dashes with hyphens in changelog to avoid encoding issues 2026-02-13 17:48:07 -06:00
314d93f3ab
docs: update changelogs for impact dashboard and integration nav improvements 2026-02-13 16:45:45 -06:00
872bef3512
feat: add 12/24-hour time format setting with consistent timezone display
wire time_format into scope, add settings UI selector, change defaults
to 24h, and replace all user-facing Calendar.strftime calls with
centralized TimeHelpers using the user's timezone and time format.
2026-02-13 15:16:29 -06:00
a6d5563b41
docs: update changelogs for command center dashboard feature 2026-02-13 14:56:01 -06:00
ee277a457e
update changelogs for gaiia integration 2026-02-13 13:29:54 -06:00
4174987a88 feat: complete DevicePollerWorker to CheckExecutorWorker migration
Completes full migration from device-level polling to per-check polling.

Migration Changes:
- Removed DevicePollerWorker scheduling from device lifecycle
- Checks automatically scheduled when created
- Discovery creates and schedules checks atomically

New Functions:
- Monitoring.stop_device_checks/1: Cancel all check jobs for device
- Monitoring.disable_device_checks/1: Disable checks when SNMP off

Discovery Integration:
- All create_*_check functions now schedule checks after creation

JobHealthCheckWorker Updates:
- Removed DevicePollerWorker recovery logic
- Only recovers DeviceMonitorWorker jobs now

Test Updates:
- Marked DevicePollerWorkerTest as skipped (deprecated)
- Updated JobHealthCheckWorkerTest expectations

All 6953 tests passing, 0 failures

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-12 17:52:33 -06:00
75d64d8772
feat: add check creation from discovery and backfill tool (Phase 5)
Completes Phase 5 of the unified checks system by enabling automatic check
creation during SNMP discovery and providing a backfill tool for existing devices.

Discovery Integration:
- create_checks_from_discovery/2: Creates checks for all discovered entities
  (sensors, interfaces, processors, storage) after SNMP discovery completes
- Links each check to its source entity via source_id for data lookup
- Returns detailed results with counts per type and error tracking
- Logs creation results with total counts and any failures

Helper Functions:
- create_sensor_check/2: Creates snmp_sensor checks with config
- create_interface_check/2: Creates snmp_interface checks
- create_processor_check/2: Creates snmp_processor checks
- create_storage_check/2: Creates snmp_storage checks

All checks configured with:
- 60-second poll intervals (default)
- Auto-discovery source type
- Enabled by default
- Type-specific configuration in JSONB config field

Backfill Tool:
- mix backfill.checks: Creates checks for existing SNMP-enabled devices
- Supports --dry-run mode for preview
- Shows counts per device (sensors, interfaces, processors, storage)
- Reports success/failure counts and detailed errors
- Safely handles devices without discovery data
- Reduced nesting depth using cond and helper functions for credo compliance

This enables the unified monitoring system to work with both new discoveries
and existing devices, ensuring all SNMP data can be monitored through the
unified checks interface.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-12 17:04:06 -06:00
d7741cdc0e
feat: implement unified checks system (Phase 1-4)
This commit implements the unified checks architecture that consolidates
SNMP monitoring with HTTP/TCP/DNS checks under a single "check" abstraction,
enabling consistent graphing, alerting, and management across all check types.

Database Changes:
- Add source_type and source_id to checks table for tracking auto-discovered
  vs manually created checks
- Add value field to check_results for storing numeric sensor readings
- Maintain backward compatibility with existing check_results data

New SNMP Executors:
- SnmpSensorExecutor: Poll sensor OIDs and return formatted values with
  status determination (OK/WARNING/CRITICAL based on limits)
- SnmpInterfaceExecutor: Poll interface stats (bandwidth, packets, errors)
- SnmpProcessorExecutor: Poll CPU/processor usage
- SnmpStorageExecutor: Poll disk/memory usage with percentage calculations

Check Execution Worker:
- CheckExecutorWorker: Unified Oban worker that dispatches to appropriate
  executor based on check_type (snmp_sensor, snmp_interface, http, tcp, etc.)
- Self-schedules next execution with distributed polling offsets
- Records results in check_results TimescaleDB hypertable
- Updates check state (OK/WARNING/CRITICAL/UNKNOWN)

Discovery Integration:
- Auto-creates checks during SNMP discovery for sensors, interfaces,
  processors, and storage
- Links checks to source entities via source_id for data lookup
- Enables/disables checks based on discovery results

UI Enhancements:
- Checks tab on device detail page with grouped display
- FormComponent for adding manual HTTP/TCP/DNS checks
- Empty state with "Run Discovery" prompt
- Check status badges and last checked times

Graphing:
- Update GraphLive to accept check_id parameter
- Query check_results table for time-series data
- Support all check types (SNMP, HTTP response times, etc.)

Testing:
- Comprehensive test suite for SnmpSensorExecutor (5 tests)
- Test suite for CheckExecutorWorker (7 tests)
- Test coverage for discovery check creation (6 tests)
- Remove deprecated monitoring_test.exs testing old API

Bug Fixes:
- Fix SNMP executors reading credentials from correct Device schema fields
  (device.snmp_version instead of device.snmp_device.version)
- Update agent channel test to query MonitoringCheck table directly

Code Quality:
- Extract add_snmp_credentials helper to reduce cyclomatic complexity
- Use map-based lookups for sensor formatting and check type grouping
- Apply pattern matching in dispatcher to reduce complexity
- All credo checks passing with no issues

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-12 16:58:40 -06:00
c6b271d204
docs: update changelogs for BruteForceProtection fix 2026-02-12 12:54:25 -06:00
cd6f2153ce
fix: reload device stream when switching back to existing devices tab 2026-02-12 12:47:30 -06:00
4e58bf24dd
docs: update changelogs for graceful shutdown handling 2026-02-12 12:18:15 -06:00
f44510bf47
docs: update user-facing changelog and document changelog maintenance
Updated priv/static/changelog.txt with all recent changes from CHANGELOG.txt
in concise, user-facing format. Enhanced CLAUDE.md to document the dual
changelog system (technical CHANGELOG.txt vs user-facing priv/static/changelog.txt)
with clear guidelines on what to include in each and when to update them.
2026-02-12 10:38:27 -06:00
e8abd8fd60
Update changelog for agent self-update feature
Added entry for agent self-update capability within Docker.
2026-02-10 13:28:48 -06:00
ba56dee1ca
remove date helper 2026-02-10 09:15:41 -06:00
631d03536e
security: add session inactivity timeout and comprehensive security documentation
Session Security Enhancements:
- Add 30-minute inactivity timeout to UpdateSessionActivity plug
- Automatic logout with user notification after inactivity
- Session timeout check happens on every request
- Graceful logout with flash message
- Refactored for Credo compliance (reduced nesting depth)

Security Documentation:
- Create comprehensive SECURITY.md covering all security features
- Document authentication, authorization, and encryption
- List OWASP Top 10 mitigations
- Include security checklist for developers
- Document recent security fixes and improvements

Verification:
- Password reset already rate-limited (confirmed)
- All 6,145 tests passing
- Zero Credo issues
- Zero security warnings

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 10:47:44 -06:00
3b0c2a36dd
update changelog 2026-02-06 13:07:20 -06:00
156d9a47bf
UI improvements 2026-02-05 14:57:11 -06:00
ed16033ac4
include changelog 2026-02-05 08:07:33 -06:00
89911bae9c
Device list bug fix 2026-02-04 16:49:17 -06:00
8382b5df6a
make devices site optional and many test fix 2026-02-04 15:05:42 -06:00
09f2907ede
Remove debugging logs, fix Mix.env call 2026-02-04 12:10:48 -06:00
c198fdeaa1
add snmp port 2026-02-03 12:51:50 -06:00
19b635c46f
feat: migrate email templates to gettext (Phase 2 - Emails)
- Update UserNotifier to use t_email() helper for all email content
- Extract 4 email subjects and 4 email bodies to emails domain:
  * Update email instructions
  * Log in instructions
  * Confirmation instructions
  * Reset password instructions
- Replace string interpolation with Gettext bindings (%{email}, %{url})
- Auto-populate English translations (msgstr = msgid)
- All emails now ready for future internationalization

First module migration complete per design plan.
2026-02-02 09:48:30 -06:00
f938b263cd
Mikrotik backup and gettext start 2026-02-02 09:11:22 -06:00
6b63dc9295
encryption updates 2026-02-01 17:05:55 -06:00
dff9c26905
fix TOTP enrollment with recovery codes 2026-01-31 14:54:44 -06:00
c690827ee0 user setting re-auth redirect hopeful fix 2026-01-31 13:32:26 -06:00
15ac68fd9c banner dissmiss fix 2026-01-31 13:09:58 -06:00
480789c3e2 banner dissmiss and mikrotik version and license 2026-01-31 13:07:09 -06:00
c4ce7a94ca memory leak fixing 2026-01-31 10:40:19 -06:00
3c00dcf37c remove passkeys for now 2026-01-31 09:50:35 -06:00
1ace5b06af fix impersonate mfa and some dialyzer issues 2026-01-30 17:04:39 -06:00
c0736d4c2e gdpr consent tracking 2026-01-29 11:12:35 -06:00
58b1aa50c2 security fixes 2026-01-28 16:55:41 -06:00
9833f61043 login redirect fix 2026-01-28 15:18:08 -06:00
aed15dd6a1 impersonate fixes 2026-01-28 14:41:27 -06:00
220f1edce3 cookie improvements 2026-01-28 12:30:28 -06:00
588639a47a gdpr cookie consent 2026-01-28 10:52:40 -06:00
88c003d474 major snmp overhaul 2026-01-28 09:07:13 -06:00
5fb92dd961
add device/org limit 2026-01-27 14:14:25 -06:00
3bb89670bd
enable agent debugging 2026-01-27 13:25:04 -06:00
328d4659a7
show correct agent on edit screen and fix airfiber/ltu 2026-01-27 12:52:43 -06:00
19a818647b
documentation updates 2026-01-26 16:36:52 -06:00
06fde717c0
accessibility and poller updates 2026-01-26 13:02:03 -06:00
96fc488023
sanitize snmp data and fix some cpu things 2026-01-22 16:53:01 -06:00
94311a48aa
discovery fix and favicon 2026-01-18 13:47:19 -06:00
6706613f24
add texas footer 2026-01-18 13:15:27 -06:00
b3d2b95200
fix logo 2026-01-06 14:44:05 -06:00
3b9fffdd07
add marketing site 2026-01-06 14:34:48 -06:00