unpoller_unpoller/pkg/inputunifi
Cody Lee c596e82cf2
fix: use v2 traffic API as DPI fallback for Network 9.1+ firmware (#985)
The legacy /stat/stadpi and /stat/sitedpi endpoints return empty data
on UniFi Network 9.1+ (issue #834). The v2 /traffic endpoint already
existed in the unifi library and in the collector, but was only called
when both SaveTraffic and SaveDPI were enabled — most users only set
SaveDPI=true and never saw any data.

- Remove the SaveTraffic gate on GetClientTraffic; call it whenever
  SaveDPI is enabled, treating it as a DPI data source
- Downgrade GetClientTraffic errors to debug-log so old firmware that
  lacks the v2 endpoint continues to use the legacy API without error
- Add convertToSiteDPI to aggregate per-client v2 data into per-site
  DPITable entries, filling SitesDPI when the legacy endpoint is empty
- Legacy API results are preserved; v2 data only supplements sites not
  already covered, so old-firmware users are unaffected

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 09:42:35 -05:00
..
LICENSE
README.md
collectevents.go chore: apply linter auto-fixes (wsl_v5, nlreturn, tagalign) (#984) 2026-03-23 21:10:52 -05:00
collector.go fix: use v2 traffic API as DPI fallback for Network 9.1+ firmware (#985) 2026-03-28 09:42:35 -05:00
discover.go Replace Python endpoint-discovery with --discover flag (replaces #936) 2026-01-30 20:17:00 -05:00
input.go feat: add Site Magic site-to-site VPN metrics (closes #926) (#983) 2026-03-23 21:08:09 -05:00
interface.go chore: apply linter auto-fixes (wsl_v5, nlreturn, tagalign) (#984) 2026-03-23 21:10:52 -05:00
remote.go chore: apply linter auto-fixes (wsl_v5, nlreturn, tagalign) (#984) 2026-03-23 21:10:52 -05:00
updateweb.go chore: apply linter auto-fixes (wsl_v5, nlreturn, tagalign) (#984) 2026-03-23 21:10:52 -05:00

README.md

inputunifi

UnPoller Input Plugin