Commit Graph

32 Commits

Author SHA1 Message Date
Cody Lee
07781214c3 Add config option to suppress unknown device type messages
Adds log_unknown_types config option (default: false) to control logging
of unknown UniFi device types. When disabled (default), unknown devices
are silently ignored to reduce log volume. When enabled, they are logged
as DEBUG messages instead of ERROR. Addresses issue #912.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-25 11:24:33 -06:00
aharper343
0b9d3de5cc First working version DPI metrics and traffic exported 2025-12-24 00:23:00 -05:00
Cody Lee
0ffe6152ab Fix multi-WAN speed test reporting (issue #841)
Speed tests were not being reported correctly for multi-WAN setups
because the device-level speedtest-status field was returning zeros.
The data has moved to a new aggregated dashboard API endpoint.

Changes:
- Add GetSpeedTests() and GetSiteSpeedTests() methods to fetch from
  /v2/api/site/{site}/aggregated-dashboard endpoint
- Create SpeedTestResult data structures to capture per-WAN metrics
- Update Prometheus exporter with new speedtest_* metrics per interface
- Update InfluxDB exporter to write speedtest measurements per WAN
- Update Datadog exporter with unifi.speedtest.* metrics per WAN
- Update metrics collection to include speed test data for all sites

Metrics now include labels/tags for:
- wan_interface: Physical interface (eth8, eth9, etc.)
- wan_group: Logical WAN name (WAN, WAN2, etc.)
- site_name: Site identifier
- source: Controller URL

Gracefully handles older controllers without the new API endpoint.

Fixes #841

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-09 16:46:14 -06:00
Cody Lee
b960695f3b Add Docker health check support
Implements #406 by adding a --health CLI flag and HEALTHCHECK instruction
to the Dockerfile. This allows Docker and container orchestration platforms
to monitor container health automatically.

Changes:
- Added --health flag that validates configuration and plugin connectivity
- Implemented HealthCheck() method in pkg/poller/commands.go
- Updated Dockerfile with HEALTHCHECK instruction (30s interval, 10s timeout)
- Updated MANUAL.md with --health flag documentation
- Added health check documentation to Docker README
- Added comments to docker-compose examples about built-in health check

The health check:
- Validates configuration file is found and parseable
- Ensures at least one input and one enabled output are configured
- Performs basic validation on enabled outputs
- Returns exit code 0 (healthy) or 1 (unhealthy)
- Runs silently for Docker compatibility

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-08 13:09:10 -06:00
Cody Lee
ffb8579369 add integration test guard;
datadog integration test works

influx package tests

update unifi version

golanglint-ci and address *all* issues.

all tests pass

bump unifi version
2023-07-31 14:40:33 -05:00
Cody Lee
c002283387 fixes the webserver default file path issues 2023-04-13 09:56:24 -05:00
Cody Lee
3768c53512 CLI works 2022-12-22 18:16:43 -06:00
Cody Lee
4259d4f396 fix the default missing config based off example config, this was affecting #443 2022-12-09 10:01:47 -06:00
Cody Lee
247cc868b3 go 1.19 interface{} -> any 2022-12-03 16:32:12 -06:00
Cody Lee
1900e69d7a all to pkg 2022-12-02 20:48:01 -05:00
davidnewhall2
5e203701b5 initial 2019-12-28 17:08:16 -08:00
davidnewhall2
bd0680b92a Add DPI collection 2019-12-27 23:59:16 -08:00
davidnewhall2
6facff1337 deps 2019-12-25 01:02:36 -08:00
davidnewhall2
84edadaa94 Make a new docker image 2019-12-24 23:43:49 -08:00
davidnewhall2
1dd5b4761c Update deps 2019-12-19 00:29:56 -08:00
davidnewhall2
da75406310 fixes 2019-12-17 02:09:30 -08:00
davidnewhall2
44c544d8e1 Add dynamic plugin support 2019-12-16 03:11:40 -08:00
davidnewhall2
0b8473657e convert input to plugin 2019-12-15 20:56:42 -08:00
davidnewhall2
1def43a4be trimming 2019-12-15 03:27:34 -08:00
davidnewhall2
ac39d1727f make output plugins call in to initialize 2019-12-15 02:52:43 -08:00
davidnewhall2
510251252b update docs 2019-12-14 19:37:41 -08:00
davidnewhall2
4f987d3225 fixes 2019-12-14 18:55:10 -08:00
davidnewhall2
062fb797de should be good 2019-12-14 18:31:13 -08:00
davidnewhall2
e220610df7 nearly there 2019-12-14 18:10:35 -08:00
davidnewhall2
f4ae4fc5e5 switch to config package 2019-12-14 16:29:29 -08:00
davidnewhall2
b8d9ac9f88 not sure how far I got.. 2019-12-13 14:17:28 -08:00
davidnewhall2
8aa071935e add lock to getunifi 2019-12-11 01:14:09 -08:00
davidnewhall2
314417abc5 Prevent poller from dying from an error 2019-12-09 00:45:46 -08:00
davidnewhall2
48f5ba2cf8 fix env variable usage 2019-12-02 13:11:35 -08:00
davidnewhall2
50c1a635c6 Improve influx library 2019-11-30 16:45:22 -08:00
davidnewhall2
cef7815e2d allow more data reduction 2019-11-30 03:42:17 -08:00
davidnewhall2
ebe05ec3e5 move pkgs, update readme, add two more metrics to influx client 2019-11-30 01:45:42 -08:00