mirror of
https://github.com/unpoller/unpoller.git
synced 2026-10-05 05:51:33 +02:00
Adds a new `unas` input plugin that polls UNAS Pro storage consoles and
exports console health, storage pools, disks and shares to Prometheus,
InfluxDB and DataDog.
UNAS is a separate plugin rather than a device type inside inputunifi
because a storage-only console has no Network application: it cannot
answer /status, has no sites, and shares none of the UniFi device schema.
The plugin is opt-in and inert until an operator names a console. Opt-in
is expressed as "no devices configured" rather than a `disable` flag,
because a bool named `disable` zero-values to false and so cannot make a
plugin default-off. Initialize returns silently on an empty device list
and, unlike inputunifi, nothing synthesizes a default URL.
Two behaviours are worth calling out for reviewers:
- Metrics returns (metrics, nil) whenever any console was collected.
poller.collectMetrics uses `if err != nil {} else if metric != nil`,
so returning both would discard every healthy console because one
failed. Only a total failure returns an error.
- Re-auth fires on total failure, not on a 401. A mid-session 401 from
GetData surfaces as ErrInvalidStatusCode, not ErrAuthenticationFailed,
so there is no sentinel to match on. Session expiry fails all four
endpoints at once, which is exactly the total-failure case.
Prometheus metrics use the `unifi_unas_` prefix, which diverges from the
`unas_` prefix used by the reference implementation; dashboards built
against that will need query edits.
Requires unifi/v5 v5.31.0 for the UNAS client and structs.
Credit to alexgreenbank/unaspoller for mapping the endpoints.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
65 lines
2.5 KiB
AMPL
65 lines
2.5 KiB
AMPL
module github.com/unpoller/unpoller
|
|
|
|
go 1.25.5
|
|
|
|
require (
|
|
github.com/DataDog/datadog-go/v5 v5.9.0
|
|
github.com/flaticols/countrycodes v0.0.2
|
|
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.24.1
|
|
github.com/prometheus/common v0.70.1
|
|
github.com/spf13/pflag v1.0.10
|
|
github.com/stretchr/testify v1.12.0
|
|
github.com/unpoller/unifi/v5 v5.31.0
|
|
go.opentelemetry.io/otel v1.45.0
|
|
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.45.0
|
|
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.45.0
|
|
go.opentelemetry.io/otel/metric v1.45.0
|
|
go.opentelemetry.io/otel/sdk v1.45.0
|
|
go.opentelemetry.io/otel/sdk/metric v1.45.0
|
|
golang.org/x/crypto v0.55.0
|
|
golang.org/x/sync v0.22.0
|
|
golang.org/x/term v0.45.0
|
|
golift.io/cnfg v0.2.5
|
|
golift.io/cnfgfile v0.0.0-20240713024420-a5436d84eb48
|
|
golift.io/version v0.0.2
|
|
gopkg.in/yaml.v3 v3.0.1
|
|
)
|
|
|
|
require (
|
|
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
|
|
github.com/go-logr/logr v1.4.4 // indirect
|
|
github.com/go-logr/stdr v1.2.2 // indirect
|
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 // indirect
|
|
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
|
|
go.opentelemetry.io/otel/trace v1.45.0 // indirect
|
|
go.opentelemetry.io/proto/otlp v1.11.0 // indirect
|
|
golang.org/x/net v0.58.0 // indirect
|
|
golang.org/x/text v0.41.0 // indirect
|
|
google.golang.org/genproto/googleapis/api v0.0.0-20260803160001-6ac0973c030d // indirect
|
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20260803160001-6ac0973c030d // indirect
|
|
google.golang.org/grpc v1.83.0 // indirect
|
|
)
|
|
|
|
require (
|
|
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
|
|
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
|
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/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.2
|
|
github.com/prometheus/procfs v0.21.1 // indirect
|
|
golang.org/x/sys v0.47.0 // indirect
|
|
google.golang.org/protobuf v1.36.11 // indirect
|
|
)
|