A UNVR or UNVR Pro runs UniFi Protect with no Network application installed.
UnPoller could not poll one at all: NewUnifi ends with GetServerData(), a GET of
/proxy/network/status, which such a console answers with its UniFi OS SPA HTML.
The controller entry died during initialisation and re-failed every interval,
never even printing a config summary -- while the Protect Integration API on the
same host answered every endpoint with the same key.
Set disable_network = true on that controller. It defaults to false, so nothing
about an existing config changes.
The Protect collectors were already complete and already not site-scoped; three
things stood between them and a Protect-only console:
- getUnifi now calls unifi.NewProtectClient, which skips the Network probe and
validates the Protect Integration API instead (unpoller/unifi#240).
- pollController aborted on getFilteredSites long before reaching
collectProtect, and collectControllerEvents did the same before
collectProtectLogs. The Network pass is extracted into pollNetwork and
skipped wholesale; the event collector list reduces to collectProtectLogs,
the only site-independent one.
- Metrics counted a poll successful only if it produced devices or clients. A
Protect-only console produces neither, so a filtered scrape of one -- the
Prometheus per-target path -- fell through to the dynamic-controller branch
and reported ErrDynamicLookupsDisabled despite a successful collection.
ProtectDevices now counts too.
Two smaller things worth calling out for reviewers:
- extractDevices dereferenced metrics.Devices unguarded. That was already a
latent panic; skipping the Network pass makes it reachable, so it is fixed
here rather than left for the first person to hit it.
- RawMetrics answers the raw-path kind for these consoles and rejects the
site-scoped kinds with ErrNetworkDisabled. Returning an empty result would
read as "this console has no devices" rather than "wrong question".
warnProtectOnly logs an error, without failing the controller, for the two
configurations that can never collect anything: disable_network with neither
Protect save flag, and save_protect_devices with no key to authenticate with.
Silently collecting nothing is the failure mode hardest to spot in a log.
pkg/inputunifi had no tests before this. input_test.go follows inputunas'
input_test.go: an httptest fake UNVR serving the console's SPA HTML for
everything but the Protect paths and the login, covering initialisation,
metrics, events, the filtered scrape, RawMetrics, both warnings, config binding
across toml/json/yaml/env, and that the shipped examples leave Network enabled.
TestProtectOnlyControllerFailsWithoutFlag pins the original bug against that
same console, so the flag is demonstrably what makes the difference.
Requires github.com/unpoller/unifi/v6 with NewProtectClient (unpoller/unifi#240).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GVreutpEATmBjm6PBw9RjQ
Collect your UniFi controller data and report it to an InfluxDB instance, or export it for Prometheus collection. Twelve Grafana Dashboards included; with screenshots. Six for InfluxDB and six for Prometheus.
Installation
See the Documentation! We're willing to help if you have troubles. Open an Issue and we'll figure out how to get things working for you. You can also get help in the #unpoller channel on the GoLift Discord server. There is also a forum post you may use to get additional help.
Description
Ubiquiti makes networking devices like switches, gateways (routers) and wireless access points. They have a line of equipment named UniFi that uses a controller to keep stats and simplify network device configuration. This controller can be installed on Windows, macOS, FreeBSD, Linux or Docker. Ubiquiti also provides a dedicated hardware device called a CloudKey that runs the controller software. More recently they've developed the Dream Machine, and UnPoller can collect its data!
UnPoller is a small Golang application that runs on Windows, macOS, FreeBSD, Linux or Docker. In Influx-mode it polls a UniFi controller every 30 seconds for measurements and exports the data to an Influx database. In Prometheus mode the poller opens a web port and accepts Prometheus polling. It converts the UniFi Controller API data into Prometheus exports on the fly.
This application requires your controller to be running all the time. If you run a UniFi controller, there's no excuse not to install Influx or Prometheus, Grafana and this app. You'll have a plethora of data at your fingertips and the ability to craft custom graphs to slice the data any way you choose. Good luck!
Supported as of Poller v2.0.2, are Loki and the collection of UniFi events, alarms, anomalies and IDS data. This data can be exported to Loki or InfluxDB, or both!
Operation
You can control this app with puppet, chef, saltstack, homebrew or a simple bash script if you needed to. Packages are available for macOS, Linux, FreeBSD and Docker. It works just fine on Windows too.
What does it look like?
There are 12 total dashboards available; the 6 InfluxDB dashboards are very similar to the 6 Prometheus dashboards. On the documentation website you'll find screenshots of some of the dashboards.
Integrations
The following fine folks are providing their services, completely free! These service integrations are used for things like storage, building, compiling, distribution and documentation support. This project succeeds because of them. Thank you!
Copyright & License
- Copyright © 2018-2020 David Newhall II.
- See LICENSE for license information.





