Compare commits

...

68 Commits

Author SHA1 Message Date
Cody Lee 2e512480d4
Merge pull request #872 from unpoller/dependabot/go_modules/golang.org/x/net-0.44.0
Bump golang.org/x/net from 0.43.0 to 0.44.0
2025-10-06 13:39:37 -05:00
Cody Lee 8fb3cb2780
Merge pull request #867 from unpoller/dependabot/go_modules/github.com/prometheus/client_golang-1.23.2
Bump github.com/prometheus/client_golang from 1.23.0 to 1.23.2
2025-10-06 13:39:25 -05:00
Cody Lee 5b8d1516eb
Merge pull request #877 from unpoller/dependabot/github_actions/docker/login-action-3.6.0
Bump docker/login-action from 3.5.0 to 3.6.0
2025-10-06 13:39:16 -05:00
dependabot[bot] 29f9cb500c
Bump golang.org/x/net from 0.43.0 to 0.44.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.43.0 to 0.44.0.
- [Commits](https://github.com/golang/net/compare/v0.43.0...v0.44.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-version: 0.44.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-06 18:38:28 +00:00
dependabot[bot] b73e9181d5
Bump github.com/prometheus/client_golang from 1.23.0 to 1.23.2
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.23.0 to 1.23.2.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.23.0...v1.23.2)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-version: 1.23.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-06 18:38:04 +00:00
dependabot[bot] 038234ba58
Bump docker/login-action from 3.5.0 to 3.6.0
Bumps [docker/login-action](https://github.com/docker/login-action) from 3.5.0 to 3.6.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v3.5.0...v3.6.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-version: 3.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-06 18:37:54 +00:00
Cody Lee 003bdd7948
Merge pull request #868 from unpoller/dependabot/go_modules/github.com/prometheus/common-0.66.1
Bump github.com/prometheus/common from 0.65.0 to 0.66.1
2025-10-06 13:37:22 -05:00
Cody Lee bf68df44f2
Merge pull request #869 from unpoller/dependabot/github_actions/actions/setup-go-6
Bump actions/setup-go from 5 to 6
2025-10-06 13:37:14 -05:00
Cody Lee 98c93359b1
Merge pull request #870 from unpoller/dependabot/github_actions/actions/stale-10
Bump actions/stale from 9 to 10
2025-10-06 13:37:09 -05:00
Cody Lee d0b5998829
Merge pull request #876 from unpoller/dependabot/github_actions/peter-evans/dockerhub-description-5
Bump peter-evans/dockerhub-description from 4 to 5
2025-10-06 13:36:55 -05:00
dependabot[bot] 428f72e256
Bump peter-evans/dockerhub-description from 4 to 5
Bumps [peter-evans/dockerhub-description](https://github.com/peter-evans/dockerhub-description) from 4 to 5.
- [Release notes](https://github.com/peter-evans/dockerhub-description/releases)
- [Commits](https://github.com/peter-evans/dockerhub-description/compare/v4...v5)

---
updated-dependencies:
- dependency-name: peter-evans/dockerhub-description
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-06 02:05:41 +00:00
dependabot[bot] 4d5a89d124
Bump actions/stale from 9 to 10
Bumps [actions/stale](https://github.com/actions/stale) from 9 to 10.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v9...v10)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-version: '10'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-08 02:06:58 +00:00
dependabot[bot] 2cf48797ae
Bump actions/setup-go from 5 to 6
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5 to 6.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-08 02:06:54 +00:00
dependabot[bot] 64416a9f8d
Bump github.com/prometheus/common from 0.65.0 to 0.66.1
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.65.0 to 0.66.1.
- [Release notes](https://github.com/prometheus/common/releases)
- [Changelog](https://github.com/prometheus/common/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/common/compare/v0.65.0...v0.66.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-version: 0.66.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-08 02:01:27 +00:00
Cody Lee 330e4a4b0b
Merge pull request #866 from unpoller/dependabot/go_modules/github.com/spf13/pflag-1.0.8 2025-09-03 21:21:34 -05:00
dependabot[bot] b976b32aad
Bump github.com/spf13/pflag from 1.0.7 to 1.0.8
Bumps [github.com/spf13/pflag](https://github.com/spf13/pflag) from 1.0.7 to 1.0.8.
- [Release notes](https://github.com/spf13/pflag/releases)
- [Commits](https://github.com/spf13/pflag/compare/v1.0.7...v1.0.8)

---
updated-dependencies:
- dependency-name: github.com/spf13/pflag
  dependency-version: 1.0.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-04 02:20:09 +00:00
Cody Lee 98ef73c597
Merge pull request #865 from unpoller/dependabot/go_modules/github.com/stretchr/testify-1.11.1 2025-09-03 05:12:19 -05:00
dependabot[bot] a8ccbbaeb3
Bump github.com/stretchr/testify from 1.11.0 to 1.11.1
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.11.0 to 1.11.1.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.11.0...v1.11.1)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-version: 1.11.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-01 04:39:45 +00:00
Cody Lee dd50960ab8
Merge pull request #863 from unpoller/dependabot/go_modules/github.com/stretchr/testify-1.11.0
Bump github.com/stretchr/testify from 1.10.0 to 1.11.0
2025-08-26 08:18:38 -05:00
dependabot[bot] 5ea181f5f8
Bump github.com/stretchr/testify from 1.10.0 to 1.11.0
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.10.0 to 1.11.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.10.0...v1.11.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-version: 1.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-25 03:57:17 +00:00
Cody Lee 91a3ce2cbc
Merge pull request #860 from unpoller/bump-unifi-5-1-1
bump unifi version to 5.1.1
2025-08-20 11:42:39 -05:00
Cody Lee b37317a88d
bump unifi version to 5.1.1 2025-08-20 11:40:37 -05:00
Cody Lee 647acd79f4
Merge pull request #859 from unpoller/dependabot/go_modules/github.com/DataDog/datadog-go/v5-5.7.0
Bump github.com/DataDog/datadog-go/v5 from 5.6.0 to 5.7.0
2025-08-20 11:39:07 -05:00
Cody Lee c3126d27e3
interface change updates 2025-08-20 11:36:29 -05:00
dependabot[bot] d36eaa41dc
Bump github.com/DataDog/datadog-go/v5 from 5.6.0 to 5.7.0
Bumps [github.com/DataDog/datadog-go/v5](https://github.com/DataDog/datadog-go) from 5.6.0 to 5.7.0.
- [Release notes](https://github.com/DataDog/datadog-go/releases)
- [Changelog](https://github.com/DataDog/datadog-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/DataDog/datadog-go/compare/v5.6.0...v5.7.0)

---
updated-dependencies:
- dependency-name: github.com/DataDog/datadog-go/v5
  dependency-version: 5.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-20 16:31:59 +00:00
Cody Lee 2686143d40
Merge pull request #852 from unpoller/dependabot/go_modules/github.com/prometheus/client_golang-1.23.0
Bump github.com/prometheus/client_golang from 1.22.0 to 1.23.0
2025-08-20 11:27:10 -05:00
dependabot[bot] 266e0e0734
Bump github.com/prometheus/client_golang from 1.22.0 to 1.23.0
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.22.0 to 1.23.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.22.0...v1.23.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-version: 1.23.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-20 16:19:37 +00:00
Cody Lee 7f083cd05f
Merge pull request #850 from unpoller/dependabot/go_modules/github.com/spf13/pflag-1.0.7
Bump github.com/spf13/pflag from 1.0.6 to 1.0.7
2025-08-20 11:18:57 -05:00
Cody Lee da38face58
Merge pull request #855 from unpoller/dependabot/go_modules/golang.org/x/net-0.43.0
Bump golang.org/x/net from 0.39.0 to 0.43.0
2025-08-20 11:18:39 -05:00
Cody Lee bffba0f672
Merge pull request #856 from unpoller/dependabot/github_actions/docker/login-action-3.5.0
Bump docker/login-action from 3.4.0 to 3.5.0
2025-08-20 11:18:28 -05:00
Cody Lee 88b4fdc503
Merge pull request #858 from unpoller/dependabot/github_actions/actions/checkout-5
Bump actions/checkout from 4 to 5
2025-08-20 11:18:18 -05:00
Cody Lee bab01e900b
Merge pull request #849 from Traxmaxx/fix/missing-loki-stream
fix: skip loki reporting if streams is empty
2025-08-20 11:18:05 -05:00
dependabot[bot] 854bfa7937
Bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-18 03:19:21 +00:00
dependabot[bot] 095e9408bc
Bump docker/login-action from 3.4.0 to 3.5.0
Bumps [docker/login-action](https://github.com/docker/login-action) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v3.4.0...v3.5.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-version: 3.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-11 03:44:06 +00:00
dependabot[bot] 27edb31d1b
Bump golang.org/x/net from 0.39.0 to 0.43.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.39.0 to 0.43.0.
- [Commits](https://github.com/golang/net/compare/v0.39.0...v0.43.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-version: 0.43.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-11 02:46:06 +00:00
dependabot[bot] 88fa1ae124
Bump github.com/spf13/pflag from 1.0.6 to 1.0.7
Bumps [github.com/spf13/pflag](https://github.com/spf13/pflag) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/spf13/pflag/releases)
- [Commits](https://github.com/spf13/pflag/compare/v1.0.6...v1.0.7)

---
updated-dependencies:
- dependency-name: github.com/spf13/pflag
  dependency-version: 1.0.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-21 02:35:58 +00:00
Traxmaxx 8fb9c3cb40 fix: skip loki reporting if streams is empty 2025-07-20 13:18:58 +02:00
Cody Lee 4040203ff8
fix homebrew formula again, other two vars 2025-04-30 16:24:41 -05:00
Cody Lee 0ae46889d8
fix homebrew formula 2025-04-30 16:20:43 -05:00
Cody Lee 4068c8c5c4
Merge pull request #822 from soflane/feature/default-site-name-override
Add support for default_site_name_override to customize default site names
2025-04-30 05:07:23 -05:00
Sofiane A 10ccd0c2d7 Correct logic for default site condition 2025-04-29 19:34:52 +02:00
Sofiane A 5a89a4634a Add default_site_name_override to support customizable default site names 2025-04-29 16:12:32 +02:00
Cody Lee 08e3668ba3
Merge pull request #819 from unpoller/dependabot/go_modules/github.com/prometheus/client_golang-1.22.0
Bump github.com/prometheus/client_golang from 1.21.1 to 1.22.0
2025-04-17 16:19:18 -05:00
Cody Lee 46c160c2df
Merge pull request #820 from unpoller/dependabot/go_modules/golang.org/x/net-0.39.0
Bump golang.org/x/net from 0.38.0 to 0.39.0
2025-04-17 16:18:50 -05:00
dependabot[bot] 8f59556ed4
Bump golang.org/x/net from 0.38.0 to 0.39.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.38.0 to 0.39.0.
- [Commits](https://github.com/golang/net/compare/v0.38.0...v0.39.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-version: 0.39.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-14 02:29:19 +00:00
dependabot[bot] 6fcb04e8ac
Bump github.com/prometheus/client_golang from 1.21.1 to 1.22.0
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.21.1 to 1.22.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.21.1...v1.22.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-version: 1.22.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-14 02:29:16 +00:00
Cody Lee 009d757ee8
Merge pull request #816 from unpoller/all-dep-updates
update all deps, update golangci-lint
2025-04-04 08:35:15 -05:00
Cody Lee 4b19b873ab
address issue 2025-04-04 08:33:58 -05:00
Cody Lee 5122360018
migrate golangci-lint config 2025-04-04 08:32:42 -05:00
Cody Lee 0790aeda22
update toolchain 2025-04-04 08:31:46 -05:00
Cody Lee e53b8d5e5a
update all deps, update golangci-lint 2025-04-04 08:30:22 -05:00
Cody Lee 6d36bf2ca4
Merge pull request #812 from unpoller/dependabot/go_modules/github.com/prometheus/common-0.63.0
Bump github.com/prometheus/common from 0.62.0 to 0.63.0
2025-03-17 21:24:08 -05:00
dependabot[bot] 60f33fa3c8
Bump github.com/prometheus/common from 0.62.0 to 0.63.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.62.0 to 0.63.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Changelog](https://github.com/prometheus/common/blob/main/RELEASE.md)
- [Commits](https://github.com/prometheus/common/compare/v0.62.0...v0.63.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-18 02:22:34 +00:00
Cody Lee b292565ecf
Merge pull request #811 from unpoller/dependabot/go_modules/github.com/prometheus/client_golang-1.21.1
Bump github.com/prometheus/client_golang from 1.20.5 to 1.21.1
2025-03-17 21:21:32 -05:00
Cody Lee 6b52db01f0
Merge pull request #813 from unpoller/dependabot/github_actions/docker/login-action-3.4.0
Bump docker/login-action from 3.3.0 to 3.4.0
2025-03-17 21:19:49 -05:00
dependabot[bot] ded2cc4b98
Bump docker/login-action from 3.3.0 to 3.4.0
Bumps [docker/login-action](https://github.com/docker/login-action) from 3.3.0 to 3.4.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v3.3.0...v3.4.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-17 02:56:22 +00:00
dependabot[bot] f932863cf9
Bump github.com/prometheus/client_golang from 1.20.5 to 1.21.1
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.5 to 1.21.1.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.20.5...v1.21.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-10 02:53:35 +00:00
Cody Lee 5c893c4c34
Merge pull request #798 from unpoller/dependabot/go_modules/github.com/spf13/pflag-1.0.6
Bump github.com/spf13/pflag from 1.0.6-0.20201009195203-85dd5c8bc61c to 1.0.6
2025-02-13 06:01:02 -05:00
Cody Lee b196d2da98
Merge pull request #801 from unpoller/dependabot/go_modules/golang.org/x/crypto-0.33.0
Bump golang.org/x/crypto from 0.32.0 to 0.33.0
2025-02-13 06:00:15 -05:00
dependabot[bot] 27402c0967
Bump golang.org/x/crypto from 0.32.0 to 0.33.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.32.0 to 0.33.0.
- [Commits](https://github.com/golang/crypto/compare/v0.32.0...v0.33.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-10 02:42:17 +00:00
dependabot[bot] 03a2a8cac1
Bump github.com/spf13/pflag
Bumps [github.com/spf13/pflag](https://github.com/spf13/pflag) from 1.0.6-0.20201009195203-85dd5c8bc61c to 1.0.6.
- [Release notes](https://github.com/spf13/pflag/releases)
- [Commits](https://github.com/spf13/pflag/commits/v1.0.6)

---
updated-dependencies:
- dependency-name: github.com/spf13/pflag
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-03 02:54:04 +00:00
Cody Lee 3b645bddbe
Merge pull request #795 from unpoller/dependabot/go_modules/github.com/prometheus/common-0.62.0
Bump github.com/prometheus/common from 0.61.0 to 0.62.0
2025-01-20 10:52:26 -06:00
dependabot[bot] acd27be3fb
Bump github.com/prometheus/common from 0.61.0 to 0.62.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.61.0 to 0.62.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Changelog](https://github.com/prometheus/common/blob/main/RELEASE.md)
- [Commits](https://github.com/prometheus/common/compare/v0.61.0...v0.62.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-20 02:49:40 +00:00
Cody Lee 9b78c88ffc
Merge pull request #792 from unpoller/dependabot/go_modules/golang.org/x/net-0.34.0
Bump golang.org/x/net from 0.33.0 to 0.34.0
2025-01-15 15:58:19 -06:00
Cody Lee a181e9596d
Merge pull request #794 from unpoller/fix-ubb-uci-metric-names
fixes metrics prefix names for ubb and uci devices
2025-01-15 15:56:08 -06:00
Cody Lee 6d4065113f
fixes metrics prefix names for ubb and uci devices 2025-01-15 15:50:47 -06:00
dependabot[bot] b08028cc72
Bump golang.org/x/net from 0.33.0 to 0.34.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.33.0 to 0.34.0.
- [Commits](https://github.com/golang/net/compare/v0.33.0...v0.34.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-13 02:45:08 +00:00
Cody Lee e946f246eb
update example conf file 2025-01-10 15:25:16 -06:00
25 changed files with 292 additions and 152 deletions

View File

@ -18,10 +18,10 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go }}
@ -38,14 +38,14 @@ jobs:
name: lint
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go }}
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
uses: golangci/golangci-lint-action@v7
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.62
version: v2.0

View File

@ -19,7 +19,7 @@ jobs:
DOCKER_REGISTRY: "ghcr.io"
DOCKER_IMAGE_NAME: "unpoller/unpoller"
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0
- run: git fetch --force --tags
@ -31,13 +31,13 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3.3.0
uses: docker/login-action@v3.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v3.3.0
uses: docker/login-action@v3.6.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
@ -53,7 +53,7 @@ jobs:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: "Install packagecloud gem"
run: gem install package_cloud
- uses: actions/setup-go@v5
- uses: actions/setup-go@v6
with:
go-version: 'stable'
cache: true
@ -78,7 +78,7 @@ jobs:
GPG_SIGNING_KEY: /tmp/key.gpg
GPG_SIGNING_KEY_ID: ${{ steps.import_gpg.outputs.keyid }}
- name: Update Docker Hub Description
uses: peter-evans/dockerhub-description@v4
uses: peter-evans/dockerhub-description@v5
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

View File

@ -7,7 +7,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
- uses: actions/stale@v10
with:
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
stale-pr-message: 'This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.'

View File

@ -1,27 +1,30 @@
run:
timeout: 3m
version: "2"
linters:
enable:
- wsl
- nlreturn
- tagalign
- revive
- tagalign
- testpackage
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- unused
output:
sort-results: true
- wsl
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- third_party$
- builtin$
- examples$
issues:
# disable the default limit so we see everything
max-same-issues: 0
max-issues-per-linter: 0
# default enable fix where the linter supports
fix: true
max-same-issues: 0
fix: true
formatters:
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$

View File

@ -538,10 +538,10 @@ brews:
- unifi-poller
license: MIT
service: |
run [opt_bin/"unpoller", "--config", etc/"unpoller/up.conf"]
run ["#{opt_bin}/unpoller", "--config", "#{etc}/unpoller/up.conf"]
keep_alive true
log_path var/"log/unpoller.log"
error_log_path var/"log/unpoller.log"
log_path "#{var}/log/unpoller.log"
error_log_path "#{var}/log/unpoller.log"
url_template: "https://github.com/unpoller/unpoller/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
test: |
assert_match "unpoller v#{version}", shell_output("#{bin}/unpoller -v 2>&1", 2)

View File

@ -143,11 +143,18 @@
# ex: file:///etc/unifi/passwd.file, windows: file://C:\\UserData\\Unifi\\Passwd.txt
pass = "unifipoller"
# API Key
# Unifi now supports API Key authentication. This is exclusive of user/pass auth.
# api_key = "unifiapikey"
# If the controller has more than one site, specify which sites to poll here.
# Set this to ["default"] to poll only the first site on the controller.
# A setting of ["all"] will poll all sites; this works if you only have 1 site too.
sites = ["all"]
# Added an example for overriding the default site name.
# default_site_name_override = "My Custom Default Site"
# Specify a timeout, leave missing to declare infinite wait. This determines the maximum
# time to wait for a response from the unifi controller on any API request.
# timeout = 60s

View File

@ -42,7 +42,7 @@
"tags": [
"customer:abcde"
]
}
},
"unifi": {
"dynamic": false,
@ -59,7 +59,8 @@
"save_dpi": false,
"save_sites": true,
"hash_pii": false,
"verify_ssl": false
"verify_ssl": false,
"default_site_name_override": "My Custom Default Site"
},
"controllers": [
{

View File

@ -60,7 +60,8 @@ unifi:
save_sites: true
hash_pii: false
verify_ssl: false
# Added an example for overriding the default site name.
# default_site_name_override: "My Custom Default Site"
controllers:
# Repeat the following stanza to poll multiple controllers.

39
go.mod
View File

@ -1,31 +1,33 @@
module github.com/unpoller/unpoller
go 1.23
go 1.24.0
toolchain go1.23.4
toolchain go1.24.2
require (
github.com/DataDog/datadog-go/v5 v5.6.0
github.com/DataDog/datadog-go/v5 v5.7.0
github.com/gorilla/mux v1.8.1
github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.20.5
github.com/prometheus/common v0.61.0
github.com/spf13/pflag v1.0.6-0.20201009195203-85dd5c8bc61c
github.com/stretchr/testify v1.10.0
github.com/unpoller/unifi/v5 v5.1.0
golang.org/x/crypto v0.31.0
golang.org/x/net v0.33.0
golang.org/x/term v0.28.0
github.com/prometheus/client_golang v1.23.2
github.com/prometheus/common v0.66.1
github.com/spf13/pflag v1.0.10
github.com/stretchr/testify v1.11.1
github.com/unpoller/unifi/v5 v5.1.1
golang.org/x/crypto v0.42.0
golang.org/x/net v0.44.0
golang.org/x/term v0.35.0
golift.io/cnfg v0.2.3
golift.io/cnfgfile v0.0.0-20240713024420-a5436d84eb48
golift.io/version v0.0.2
gopkg.in/yaml.v3 v3.0.1
)
require go.yaml.in/yaml/v2 v2.4.2 // indirect
require (
github.com/BurntSushi/toml v1.4.0 // indirect
github.com/Microsoft/go-winio v0.6.0 // indirect
github.com/BurntSushi/toml v1.5.0 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/brianvoe/gofakeit/v6 v6.28.0 // indirect
@ -34,17 +36,14 @@ require (
github.com/google/uuid v1.6.0 // indirect
github.com/influxdata/influxdb-client-go/v2 v2.14.0
github.com/influxdata/line-protocol v0.0.0-20210922203350-b1ad95c89adf // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/oapi-codegen/runtime v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
golang.org/x/mod v0.7.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/tools v0.3.0 // indirect
google.golang.org/protobuf v1.35.2 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/procfs v0.16.1 // indirect
golang.org/x/sys v0.36.0 // indirect
google.golang.org/protobuf v1.36.8 // indirect
)
// for local iterative development only

78
go.sum
View File

@ -1,10 +1,10 @@
github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/DataDog/datadog-go/v5 v5.6.0 h1:2oCLxjF/4htd55piM75baflj/KoE6VYS7alEUqFvRDw=
github.com/DataDog/datadog-go/v5 v5.6.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw=
github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg=
github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/DataDog/datadog-go/v5 v5.7.0 h1:Lcd7cUMiKl5MrNqP7FbNuQ2Le4WKhLb5VVXddWlbGrA=
github.com/DataDog/datadog-go/v5 v5.7.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw=
github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84=
github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg=
github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE=
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk=
github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ=
github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk=
@ -20,8 +20,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
@ -33,8 +33,8 @@ github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c/go.mod
github.com/influxdata/line-protocol v0.0.0-20210922203350-b1ad95c89adf h1:7JTmneyiNEwVBOHSjoMxiWAqB992atOeepeFYegn5RU=
github.com/influxdata/line-protocol v0.0.0-20210922203350-b1ad95c89adf/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo=
github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE=
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
@ -49,19 +49,19 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y=
github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
github.com/prometheus/common v0.61.0 h1:3gv/GThfX0cV2lpO7gkTUwZru38mxevy90Bj8YFSRQQ=
github.com/prometheus/common v0.61.0/go.mod h1:zr29OCN/2BsJRaFwG8QOBr41D6kkchKbpeNH7pAjb/s=
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o=
github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg=
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
github.com/prometheus/common v0.66.1 h1:h5E0h5/Y8niHc5DlaLlWLArTQI7tMrsfQjHV+d9ZoGs=
github.com/prometheus/common v0.66.1/go.mod h1:gcaUsgf3KfRSwHY4dIMXLPV0K/Wg1oZ8+SbZk/HH/dA=
github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg=
github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/spf13/pflag v1.0.6-0.20201009195203-85dd5c8bc61c h1:zqmyTlQyufRC65JnImJ6H1Sf7BDj8bG31EV919NVEQc=
github.com/spf13/pflag v1.0.6-0.20201009195203-85dd5c8bc61c/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
@ -73,27 +73,27 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/unpoller/unifi/v5 v5.1.0 h1:ubX/dugKUXvUlxDupoyPcnevck34dTFDFm3M2n4T75o=
github.com/unpoller/unifi/v5 v5.1.0/go.mod h1:G45KRuSH9PFrIUFmDTzWEEM/E/e7GuyXp36AVOfhm7I=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/unpoller/unifi/v5 v5.1.1 h1:1QXWoT8cqeTIzRg2cY7AerxqYtNaxuCdVnuPaOui71c=
github.com/unpoller/unifi/v5 v5.1.1/go.mod h1:67cwaiQyZ4v5t1NNB3X/E0T5oe9jcZiqyithMgVXDlk=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI=
go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/crypto v0.42.0 h1:chiH31gIWm57EkTXpwnqf8qeuMUi0yekh6mT2AvFlqI=
golang.org/x/crypto v0.42.0/go.mod h1:4+rDnOTJhQCx2q7/j6rAN5XDw8kPjeaXEUR2eL94ix8=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA=
golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
golang.org/x/net v0.44.0 h1:evd8IRDyfNBMBTTY5XRF1vaZlD+EmWx6x8PkhR04H/I=
golang.org/x/net v0.44.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@ -101,18 +101,16 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k=
golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg=
golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek=
golang.org/x/term v0.35.0 h1:bZBVKBudEyhRcajGcNc3jIfWPqV4y/Kt2XcoigOWtDQ=
golang.org/x/term v0.35.0/go.mod h1:TPGtkTLesOwf2DE8CgVYiZinHAOuy5AYUYT1lENIZnA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.3.0 h1:SrNbZl6ECOS1qFzgTdQfWXZM9XBkiA6tkFrH9YSTPHM=
golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@ -122,8 +120,8 @@ golift.io/cnfgfile v0.0.0-20240713024420-a5436d84eb48 h1:c7cJWRr0cUnFHKtq072esKz
golift.io/cnfgfile v0.0.0-20240713024420-a5436d84eb48/go.mod h1:zHm9o8SkZ6Mm5DfGahsrEJPsogyR0qItP59s5lJ98/I=
golift.io/version v0.0.2 h1:i0gXRuSDHKs4O0sVDUg4+vNIuOxYoXhaxspftu2FRTE=
golift.io/version v0.0.2/go.mod h1:76aHNz8/Pm7CbuxIsDi97jABL5Zui3f2uZxDm4vB6hU=
google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io=
google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
google.golang.org/protobuf v1.36.8 h1:xHScyCOEuuwZEc6UtSOvPbAT4zRh0xcNRYekJwfqyMc=
google.golang.org/protobuf v1.36.8/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=

View File

@ -106,7 +106,7 @@ func (u *DatadogUnifi) setConfigDefaults() {
u.Interval = cnfg.Duration{Duration: minimumInterval}
}
u.Interval = cnfg.Duration{Duration: u.Interval.Duration.Round(time.Second)}
u.Interval = cnfg.Duration{Duration: u.Interval.Round(time.Second)}
u.options = make([]statsd.Option, 0)
@ -182,7 +182,7 @@ func (u *DatadogUnifi) DebugOutput() (bool, error) {
u.Statsd, err = statsd.New(u.Address, u.options...)
if err != nil {
return false, fmt.Errorf("Error configuration Datadog agent reporting: %+v", err)
return false, fmt.Errorf("error configuration Datadog agent reporting: %+v", err)
}
return true, nil

View File

@ -36,14 +36,14 @@ type mockStatsd struct {
// GaugeWithTimestamp mock interface
// nolint:all
func (m *mockStatsd) GaugeWithTimestamp(name string, value float64, tags []string, rate float64, timestamp time.Time) error {
func (m *mockStatsd) GaugeWithTimestamp(name string, value float64, tags []string, rate float64, timestamp time.Time, _ ...statsd.Parameter) error {
// not supported
return nil
}
// CountWithTimestamp mock interface
// nolint:all
func (m *mockStatsd) CountWithTimestamp(name string, value int64, tags []string, rate float64, timestamp time.Time) error {
func (m *mockStatsd) CountWithTimestamp(name string, value int64, tags []string, rate float64, timestamp time.Time, _ ...statsd.Parameter) error {
// not supported
return nil
}
@ -56,25 +56,25 @@ func (m *mockStatsd) IsClosed() bool {
// HistogramWithTimestamp mock interface
// nolint:all
func (m *mockStatsd) HistogramWithTimestamp(name string, value float64, tags []string, rate float64, timestamp time.Time) error {
func (m *mockStatsd) HistogramWithTimestamp(name string, value float64, tags []string, rate float64, timestamp time.Time, _ ...statsd.Parameter) error {
return nil
}
// DistributionWithTimestamp mock interface
// nolint:all
func (m *mockStatsd) DistributionWithTimestamp(name string, value float64, tags []string, rate float64, timestamp time.Time) error {
func (m *mockStatsd) DistributionWithTimestamp(name string, value float64, tags []string, rate float64, timestamp time.Time, _ ...statsd.Parameter) error {
return nil
}
// SetWithTimestamp mock interface
// nolint:all
func (m *mockStatsd) SetWithTimestamp(name string, value float64, tags []string, rate float64, timestamp time.Time) error {
func (m *mockStatsd) SetWithTimestamp(name string, value float64, tags []string, rate float64, timestamp time.Time, _ ...statsd.Parameter) error {
return nil
}
// TimingWithTimestamp mock interface
// nolint:all
func (m *mockStatsd) TimingWithTimestamp(name string, value int64, tags []string, rate float64) error {
func (m *mockStatsd) TimingWithTimestamp(name string, value int64, tags []string, rate float64, _ ...statsd.Parameter) error {
return nil
}
@ -85,7 +85,7 @@ func (m *mockStatsd) GetTelemetry() statsd.Telemetry {
}
// Gauge measures the value of a metric at a particular time.
func (m *mockStatsd) Gauge(name string, value float64, tags []string, _ float64) error {
func (m *mockStatsd) Gauge(name string, value float64, tags []string, _ float64, _ ...statsd.Parameter) error {
m.Lock()
defer m.Unlock()
@ -95,7 +95,7 @@ func (m *mockStatsd) Gauge(name string, value float64, tags []string, _ float64)
}
// Count tracks how many times something happened per second.
func (m *mockStatsd) Count(name string, value int64, tags []string, _ float64) error {
func (m *mockStatsd) Count(name string, value int64, tags []string, _ float64, _ ...statsd.Parameter) error {
m.Lock()
defer m.Unlock()
@ -105,7 +105,7 @@ func (m *mockStatsd) Count(name string, value int64, tags []string, _ float64) e
}
// Histogram tracks the statistical distribution of a set of values on each host.
func (m *mockStatsd) Histogram(name string, value float64, tags []string, _ float64) error {
func (m *mockStatsd) Histogram(name string, value float64, tags []string, _ float64, _ ...statsd.Parameter) error {
m.Lock()
defer m.Unlock()
@ -115,7 +115,7 @@ func (m *mockStatsd) Histogram(name string, value float64, tags []string, _ floa
}
// Distribution tracks the statistical distribution of a set of values across your infrastructure.
func (m *mockStatsd) Distribution(name string, value float64, tags []string, _ float64) error {
func (m *mockStatsd) Distribution(name string, value float64, tags []string, _ float64, _ ...statsd.Parameter) error {
m.Lock()
defer m.Unlock()
@ -125,7 +125,7 @@ func (m *mockStatsd) Distribution(name string, value float64, tags []string, _ f
}
// Decr is just Count of -1
func (m *mockStatsd) Decr(name string, tags []string, _ float64) error {
func (m *mockStatsd) Decr(name string, tags []string, _ float64, _ ...statsd.Parameter) error {
m.Lock()
defer m.Unlock()
@ -135,7 +135,7 @@ func (m *mockStatsd) Decr(name string, tags []string, _ float64) error {
}
// Incr is just Count of 1
func (m *mockStatsd) Incr(name string, tags []string, _ float64) error {
func (m *mockStatsd) Incr(name string, tags []string, _ float64, _ ...statsd.Parameter) error {
m.Lock()
defer m.Unlock()
@ -145,7 +145,7 @@ func (m *mockStatsd) Incr(name string, tags []string, _ float64) error {
}
// Set counts the number of unique elements in a group.
func (m *mockStatsd) Set(name string, value string, tags []string, _ float64) error {
func (m *mockStatsd) Set(name string, value string, tags []string, _ float64, _ ...statsd.Parameter) error {
m.Lock()
defer m.Unlock()
@ -155,7 +155,7 @@ func (m *mockStatsd) Set(name string, value string, tags []string, _ float64) er
}
// Timing sends timing information, it is an alias for TimeInMilliseconds
func (m *mockStatsd) Timing(name string, value time.Duration, tags []string, _ float64) error {
func (m *mockStatsd) Timing(name string, value time.Duration, tags []string, _ float64, _ ...statsd.Parameter) error {
m.Lock()
defer m.Unlock()
@ -166,7 +166,7 @@ func (m *mockStatsd) Timing(name string, value time.Duration, tags []string, _ f
// TimeInMilliseconds sends timing information in milliseconds.
// It is flushed by statsd with percentiles, mean and other info (https://github.com/etsy/statsd/blob/master/docs/metric_types.md#timing)
func (m *mockStatsd) TimeInMilliseconds(name string, value float64, tags []string, _ float64) error {
func (m *mockStatsd) TimeInMilliseconds(name string, value float64, tags []string, _ float64, _ ...statsd.Parameter) error {
m.Lock()
defer m.Unlock()
@ -176,7 +176,7 @@ func (m *mockStatsd) TimeInMilliseconds(name string, value float64, tags []strin
}
// Event sends the provided Event.
func (m *mockStatsd) Event(e *statsd.Event) error {
func (m *mockStatsd) Event(e *statsd.Event, _ ...statsd.Parameter) error {
m.Lock()
defer m.Unlock()
@ -186,7 +186,7 @@ func (m *mockStatsd) Event(e *statsd.Event) error {
}
// SimpleEvent sends an event with the provided title and text.
func (m *mockStatsd) SimpleEvent(title, _ string) error {
func (m *mockStatsd) SimpleEvent(title, _ string, _ ...statsd.Parameter) error {
m.Lock()
defer m.Unlock()
@ -196,7 +196,7 @@ func (m *mockStatsd) SimpleEvent(title, _ string) error {
}
// ServiceCheck sends the provided ServiceCheck.
func (m *mockStatsd) ServiceCheck(sc *statsd.ServiceCheck) error {
func (m *mockStatsd) ServiceCheck(sc *statsd.ServiceCheck, _ ...statsd.Parameter) error {
m.Lock()
defer m.Unlock()
@ -206,7 +206,7 @@ func (m *mockStatsd) ServiceCheck(sc *statsd.ServiceCheck) error {
}
// SimpleServiceCheck sends an serviceCheck with the provided name and status.
func (m *mockStatsd) SimpleServiceCheck(name string, _ statsd.ServiceCheckStatus) error {
func (m *mockStatsd) SimpleServiceCheck(name string, _ statsd.ServiceCheckStatus, _ ...statsd.Parameter) error {
m.Lock()
defer m.Unlock()

View File

@ -372,6 +372,49 @@ gauges:
- unifi.ubb.uplink_uptime
- unifi.usg.uplink_max_speed
- unifi.usg.uplink_uptime
- unifi.ubb.stat_rx_frags
- unifi.uci.stat_tx_retries
- unifi.uci.stat_rx_bytes
- unifi.ubb.stat_rx_errors
- unifi.uci.mem_total
- unifi.ubb.stat_rx_packets
- unifi.uci.sys
- unifi.uci.bytes
- unifi.uci.stat_bytes
- unifi.uci.stat_rx_errors
- unifi.ubb.stat_tx_bytes
- unifi.uci.rx_bytes
- unifi.uci.mem_used
- unifi.uci.probe
- unifi.uci.memory
- unifi.uci.mem_buffer
- unifi.uci.uptime
- unifi.ubb.stat_tx_packets
- unifi.ubb.stat_tx_retries
- unifi.uci.stat_rx_frags
- unifi.ubb.stat_rx_crypts
- unifi.ubb.stat_tx_dropped
- unifi.ubb.stat_rx_dropped
- unifi.ubb.stat_bytes
- unifi.uci.mem
- unifi.uci.stat_rx_crypts
- unifi.uci.last_seen
- unifi.ubb.stat_rx_bytes
- unifi.uci.stat_rx_dropped
- unifi.uci.system_uptime
- unifi.uci.stat_tx_errors
- unifi.uci.network
- unifi.ubb.stat_tx_errors
- unifi.uci.loadavg_1
- unifi.uci.loadavg_5
- unifi.uci.cpu
- unifi.uci.stat_tx_bytes
- unifi.uci.stat_tx_packets
- unifi.uci.loadavg_15
- unifi.uci.tx_bytes
- unifi.uci.stat_rx_packets
- unifi.uci.stat_tx_dropped
- unifi.uci.state
counts:
- unifi.collector.num_devices
- unifi.collector.num_errors

View File

@ -85,7 +85,7 @@ func (u *DatadogUnifi) batchUBB(r report, s *unifi.UBB) { // nolint: funlen
"uptime": s.Uptime.Val,
})
metricName = metricNamespace("usw")
metricName = metricNamespace("ubb")
reportGaugeForFloat64Map(r, metricName, data, tags)
}

View File

@ -56,7 +56,7 @@ func (u *DatadogUnifi) batchUCI(r report, s *unifi.UCI) { // nolint: funlen
r.addCount(uciT)
metricName := metricNamespace("usg")
metricName := metricNamespace("uci")
reportGaugeForFloat64Map(r, metricName, data, tags)
tags = cleanTags(map[string]string{
@ -80,6 +80,6 @@ func (u *DatadogUnifi) batchUCI(r report, s *unifi.UCI) { // nolint: funlen
"uptime": s.Uptime.Val,
})
metricName = metricNamespace("usw")
metricName = metricNamespace("uci")
reportGaugeForFloat64Map(r, metricName, data, tags)
}

View File

@ -165,7 +165,7 @@ func (u *InfluxUnifi) DebugOutput() (bool, error) {
u.setConfigDefaults()
_, err := url.Parse(u.Config.URL)
_, err := url.Parse(u.URL)
if err != nil {
return false, fmt.Errorf("invalid influx URL: %v", err)
}
@ -223,7 +223,7 @@ func (u *InfluxUnifi) Run(c poller.Collect) error {
u.setConfigDefaults()
_, err = url.Parse(u.Config.URL)
_, err = url.Parse(u.URL)
if err != nil {
u.LogErrorf("invalid influx URL: %v", err)
@ -304,7 +304,7 @@ func (u *InfluxUnifi) setConfigDefaults() {
u.Interval = cnfg.Duration{Duration: minimumInterval}
}
u.Interval = cnfg.Duration{Duration: u.Interval.Duration.Round(time.Second)}
u.Interval = cnfg.Duration{Duration: u.Interval.Round(time.Second)}
}
func (u *InfluxUnifi) getPassFromFile(filename string) string {

View File

@ -402,9 +402,19 @@ points:
- version
fields:
bytes: float
cpu: float
ip: string
last_seen: float
license_state: string
loadavg_1: float
loadavg_5: float
loadavg_15: float
mem: float
mem_buffer: float
mem_total: float
mem_used: float
rx_bytes: float
source: string
stat_bytes: float
stat_rx_bytes: float
stat_rx_crypts: float
@ -417,8 +427,68 @@ points:
stat_tx_errors: float
stat_tx_packets: float
stat_tx_retries: float
state: float
system_uptime: float
temp_cpu: int
temp_memory: int
temp_network: int
temp_probe: int
temp_sys: int
tx_bytes: float
uplink_latency: float
uplink_max_speed: float
uplink_speed: float
uplink_uptime: float
uptime: float
user-num_sta: float
version: string
uci:
tags:
- mac
- model
- name
- serial
- site_name
- source
- type
- version
fields:
bytes: float
cpu: float
ip: string
last_seen: float
license_state: string
loadavg_1: float
loadavg_5: float
loadavg_15: float
mem: float
mem_buffer: float
mem_total: float
mem_used: float
rx_bytes: float
source: string
stat_bytes: float
stat_rx_bytes: float
stat_rx_crypts: float
stat_rx_dropped: float
stat_rx_errors: float
stat_rx_frags: float
stat_rx_packets: float
stat_tx_bytes: float
stat_tx_dropped: float
stat_tx_errors: float
stat_tx_packets: float
stat_tx_retries: float
state: float
system_uptime: float
temp_cpu: int
temp_memory: int
temp_network: int
temp_probe: int
temp_sys: int
tx_bytes: float
uptime: float
version: string
unifi_alarm:
tags:
- action

View File

@ -62,7 +62,7 @@ func (u *InfluxUnifi) batchUBB(r report, s *unifi.UBB) { // nolint: funlen
)
r.addCount(ubbT)
r.send(&metric{Table: "usg", Tags: tags, Fields: fields})
r.send(&metric{Table: "ubb", Tags: tags, Fields: fields})
tags = map[string]string{
"mac": s.Mac,

View File

@ -57,7 +57,7 @@ func (u *InfluxUnifi) batchUCI(r report, s *unifi.UCI) { // nolint: funlen
)
r.addCount(uciT)
r.send(&metric{Table: "usg", Tags: tags, Fields: fields})
r.send(&metric{Table: "uci", Tags: tags, Fields: fields})
tags = map[string]string{
"mac": s.Mac,
@ -80,5 +80,5 @@ func (u *InfluxUnifi) batchUCI(r report, s *unifi.UCI) { // nolint: funlen
"uptime": s.Uptime.Val,
})
r.send(&metric{Table: "usw", Tags: tags, Fields: fields})
r.send(&metric{Table: "uci", Tags: tags, Fields: fields})
}

View File

@ -278,7 +278,14 @@ func (u *InputUnifi) getFilteredSites(c *Controller) ([]*unifi.Site, error) {
sites, err := c.Unifi.GetSites()
if err != nil {
return nil, fmt.Errorf("controller: %w", err)
} else if len(c.Sites) == 0 || StringInSlice("all", c.Sites) {
}
// Apply the default_site_name_override to the first site in the list, if configured.
if len(sites) > 0 && c.DefaultSiteNameOverride != "" {
sites[0].Name = c.DefaultSiteNameOverride
}
if len(c.Sites) == 0 || StringInSlice("all", c.Sites) {
return sites, nil
}

View File

@ -34,24 +34,25 @@ type InputUnifi struct {
// Controller represents the configuration for a UniFi Controller.
// Each polled controller may have its own configuration.
type Controller struct {
VerifySSL *bool `json:"verify_ssl" toml:"verify_ssl" xml:"verify_ssl" yaml:"verify_ssl"`
SaveAnomal *bool `json:"save_anomalies" toml:"save_anomalies" xml:"save_anomalies" yaml:"save_anomalies"`
SaveAlarms *bool `json:"save_alarms" toml:"save_alarms" xml:"save_alarms" yaml:"save_alarms"`
SaveEvents *bool `json:"save_events" toml:"save_events" xml:"save_events" yaml:"save_events"`
SaveIDs *bool `json:"save_ids" toml:"save_ids" xml:"save_ids" yaml:"save_ids"`
SaveDPI *bool `json:"save_dpi" toml:"save_dpi" xml:"save_dpi" yaml:"save_dpi"`
SaveRogue *bool `json:"save_rogue" toml:"save_rogue" xml:"save_rogue" yaml:"save_rogue"`
HashPII *bool `json:"hash_pii" toml:"hash_pii" xml:"hash_pii" yaml:"hash_pii"`
DropPII *bool `json:"drop_pii" toml:"drop_pii" xml:"drop_pii" yaml:"drop_pii"`
SaveSites *bool `json:"save_sites" toml:"save_sites" xml:"save_sites" yaml:"save_sites"`
CertPaths []string `json:"ssl_cert_paths" toml:"ssl_cert_paths" xml:"ssl_cert_path" yaml:"ssl_cert_paths"`
User string `json:"user" toml:"user" xml:"user" yaml:"user"`
Pass string `json:"pass" toml:"pass" xml:"pass" yaml:"pass"`
APIKey string `json:"api_key" toml:"api_key" xml:"api_key" yaml:"api_key"`
URL string `json:"url" toml:"url" xml:"url" yaml:"url"`
Sites []string `json:"sites" toml:"sites" xml:"site" yaml:"sites"`
Unifi *unifi.Unifi `json:"-" toml:"-" xml:"-" yaml:"-"`
ID string `json:"id,omitempty"` // this is an output, not an input.
VerifySSL *bool `json:"verify_ssl" toml:"verify_ssl" xml:"verify_ssl" yaml:"verify_ssl"`
SaveAnomal *bool `json:"save_anomalies" toml:"save_anomalies" xml:"save_anomalies" yaml:"save_anomalies"`
SaveAlarms *bool `json:"save_alarms" toml:"save_alarms" xml:"save_alarms" yaml:"save_alarms"`
SaveEvents *bool `json:"save_events" toml:"save_events" xml:"save_events" yaml:"save_events"`
SaveIDs *bool `json:"save_ids" toml:"save_ids" xml:"save_ids" yaml:"save_ids"`
SaveDPI *bool `json:"save_dpi" toml:"save_dpi" xml:"save_dpi" yaml:"save_dpi"`
SaveRogue *bool `json:"save_rogue" toml:"save_rogue" xml:"save_rogue" yaml:"save_rogue"`
HashPII *bool `json:"hash_pii" toml:"hash_pii" xml:"hash_pii" yaml:"hash_pii"`
DropPII *bool `json:"drop_pii" toml:"drop_pii" xml:"drop_pii" yaml:"drop_pii"`
SaveSites *bool `json:"save_sites" toml:"save_sites" xml:"save_sites" yaml:"save_sites"`
CertPaths []string `json:"ssl_cert_paths" toml:"ssl_cert_paths" xml:"ssl_cert_path" yaml:"ssl_cert_paths"`
User string `json:"user" toml:"user" xml:"user" yaml:"user"`
Pass string `json:"pass" toml:"pass" xml:"pass" yaml:"pass"`
APIKey string `json:"api_key" toml:"api_key" xml:"api_key" yaml:"api_key"`
URL string `json:"url" toml:"url" xml:"url" yaml:"url"`
Sites []string `json:"sites" toml:"sites" xml:"site" yaml:"sites"`
DefaultSiteNameOverride string `json:"default_site_name_override" toml:"default_site_name_override" xml:"default_site_name_override" yaml:"default_site_name_override"`
Unifi *unifi.Unifi `json:"-" toml:"-" xml:"-" yaml:"-"`
ID string `json:"id,omitempty"` // this is an output, not an input.
}
// Config contains our configuration data.
@ -358,6 +359,11 @@ func (u *InputUnifi) setControllerDefaults(c *Controller) *Controller { //nolint
c.Sites = u.Default.Sites
}
// Added handling for the new default_site_name_override parameter.
if c.DefaultSiteNameOverride == "" {
c.DefaultSiteNameOverride = u.Default.DefaultSiteNameOverride
}
return c
}

View File

@ -180,6 +180,11 @@ func (l *Loki) ProcessEvents(report *Report, events *poller.Events) error {
}
logs := report.ProcessEventLogs(events)
if len(logs.Streams) == 0 {
l.LogDebugf("No new events to send to Loki.")
return nil
}
if err := l.client.Post(logs); err != nil {
return fmt.Errorf("sending to Loki failed: %w", err)
}

View File

@ -56,7 +56,7 @@ func (u *UnifiPoller) Start() error {
}
log.Fatal("Failed debug checks")
return err
}
@ -88,7 +88,7 @@ func (f *Flags) Parse(args []string) {
// 3. Start a web server and wait for Prometheus to poll the application for metrics.
func (u *UnifiPoller) Run() error {
if u.Flags.DumpJSON != "" {
u.Config.Quiet = true
u.Quiet = true
if err := u.InitializeInputs(); err != nil {
return err
}

View File

@ -306,7 +306,7 @@ func (u *promUnifi) collect(ch chan<- prometheus.Metric, filter *poller.Filter)
r := &Report{
Config: u.Config,
ch: make(chan []*metric, u.Config.Buffer),
ch: make(chan []*metric, u.Buffer),
Start: time.Now(),
}
defer r.close()

View File

@ -176,7 +176,7 @@ func (w *webPlugins) newInputEvent(plugin, id string, event *Event) {
input.Events[id] = &EventGroup{}
}
input.Events[id].add(event, int(w.Config.MaxEvents))
input.Events[id].add(event, int(w.MaxEvents))
}
func (w *webPlugins) newOutputEvent(plugin, id string, event *Event) {
@ -196,7 +196,7 @@ func (w *webPlugins) newOutputEvent(plugin, id string, event *Event) {
output.Events[id] = &EventGroup{}
}
output.Events[id].add(event, int(w.Config.MaxEvents))
output.Events[id].add(event, int(w.MaxEvents))
}
func (w *webPlugins) newInput(config *Input) {