towerops/lib/mix/tasks
Graham McIntire c545672efe fix(snmp): auto-rescale implausible temperature readings
Some MikroTik models report `mtxrGaugeValue` (mtxrGaugeUnit=1, °C) in
deci-degrees, while others — like the CRS317 in upstream test data —
return whole degrees. The MIB doesn't disclose which, so the YAML
profile can't pick one literal divisor. Result: a sensor that should
read 56.92 °C was being stored and alerted on as 5,692 °C.

- Towerops.Snmp.SensorScale.normalize/2: divide-by-10 a temperature
  reading until it falls below 150 °C, capped at 3 iterations. Other
  sensor types pass through untouched.
- DevicePollerWorker.poll_simple_sensor wires the normaliser in after
  the YAML divisor is applied, so live polling stops storing bogus
  values immediately.
- DeviceOverheating rule now bounds the query at 150 °C as defense in
  depth so a future scaling glitch never produces a 5,000 °C alert.
- mix towerops.fix_mikrotik_temperature_scaling backfills any rows
  already in the DB by re-running normalize/2 over them.
- routeros.yaml profile gets a comment pointing at the runtime
  normaliser instead of a wrong unconditional divisor.
2026-05-10 12:21:24 -05:00
..
backfill_checks.ex feat: add check creation from discovery and backfill tool (Phase 5) 2026-02-12 17:04:06 -06:00
compile.towerops_nif.ex complete overhaul of snmp engine to C nif 2026-01-30 12:27:12 -06:00
copy_mibs.ex Remove debugging logs, fix Mix.env call 2026-02-04 12:10:48 -06:00
gen_vendor_modules.ex more tests 2026-01-22 11:51:35 -06:00
gen_vendor_tests.ex more tests 2026-01-22 11:51:35 -06:00
geoip.import.ex tests: raise coverage to 70% via helper promotion + new unit/property tests 2026-04-24 09:49:06 -05:00
import_mibs.ex feat: add 5 new vendor modules and fix dialyzer issues 2026-01-22 09:34:50 -06:00
import_profiles.ex more tests 2026-02-03 10:19:56 -06:00
oban.cancel_stuck_discovery.ex dialyzer: fix remaining 88 warnings — clean dialyzer run 2026-04-21 10:32:42 -05:00
populate_english.ex mikrotik api update 2026-02-02 10:35:44 -06:00
totp_diagnose.exs security fixes 2026-01-28 17:02:36 -06:00
totp_time_check.exs security fixes 2026-01-28 17:02:36 -06:00
towerops.fix_mikrotik_temperature_scaling.ex fix(snmp): auto-rescale implausible temperature readings 2026-05-10 12:21:24 -05:00
unused.ex feat: implement mix_unused-style 'mix unused' task using Erlang xref 2026-05-08 12:30:49 -05:00
upload_mibs.ex handle mib uploading 2026-01-18 16:29:24 -06:00