towerops/lib/towerops_web/live/device_live
Graham McIntire e181c17f78
fix: resolve MikroTik sensor values and empty SNMP communities
Fixes three critical issues affecting agent-based SNMP polling:

1. MikroTik gauge sensors incorrectly showing 10x values (223°C instead of 22.3°C)
   - Root cause: get_int_value() rejected zero values, causing mtxrGaugeUnit
     to be treated as nil and bypassing divisor logic
   - Fixed: Accept zero values and apply correct divisor=10 for temp/voltage/current/power

2. Empty SNMP community strings sent to agents causing authentication failures
   - Root cause: Devices with source="device" but null community weren't falling
     back to organization/site inheritance
   - Fixed: Enhanced resolve_snmp_community() to fall back to inheritance chain
     even when source="device" but community is empty

3. Continuous MikroTik API commands sent every 60s instead of once per 24h
   - Root cause: MikroTik jobs built on every poll cycle, not just discovery
   - Fixed: Only build MikroTik jobs during discovery phase

Migrations update existing data to fix incorrect divisor values and community
source tracking. Added comprehensive debug logging to diagnose future issues.
2026-02-02 17:12:36 -06:00
..
form.ex feat: migrate equipment features to gettext and fix sudo mode tests 2026-02-02 12:41:58 -06:00
form.html.heex device edit refactor 2026-02-02 10:00:00 -06:00
index.ex feat: migrate equipment features to gettext and fix sudo mode tests 2026-02-02 12:41:58 -06:00
index.html.heex paginate discovered devices 2026-01-31 10:31:37 -06:00
show.ex handle mikrotik ssh 2026-02-02 16:42:18 -06:00
show.html.heex fix: resolve MikroTik sensor values and empty SNMP communities 2026-02-02 17:12:36 -06:00