Application: Collect ALL UniFi Controller, Site, Device & Client Data - Export to InfluxDB or Prometheus
Go to file
Cody Lee dabfeffe66
fix(prometheus): serve scrapes from cached background poll (#1013)
Decouples Prometheus scrape cadence from upstream UniFi API calls so a
429 backoff loop on the controller side no longer stalls /metrics. The
output plugin now owns a 60s background poller (configurable) whose
result is served from an in-memory cache. Concurrent /scrape requests
for the same target are coalesced via singleflight to prevent a noisy
scraper from multiplying upstream load.

Adds two new metrics so operators can detect cache staleness and
refresh failures independently:
- unpoller_prometheus_cache_age_seconds
- unpoller_prometheus_refresh_failures_total

Background goroutine recovers from panics so a malformed input payload
no longer silently kills refreshes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 17:43:44 -05:00
.github build(deps): bump docker/login-action in the all group 2026-04-06 02:43:55 +00:00
alerts feat: UPS battery metrics, example Prometheus/Loki alerts (unpoller#930) (#941) 2026-01-31 20:25:58 -06:00
docs deps: use unifi v5.13.0, remove replace and CI unifi checkout 2026-01-30 20:58:10 -05:00
examples fix(prometheus): serve scrapes from cached background poll (#1013) 2026-05-11 17:43:44 -05:00
init feat: add docker-compose example for remote (ui.com cloud) mode 2026-04-10 14:58:18 +02:00
pkg fix(prometheus): serve scrapes from cached background poll (#1013) 2026-05-11 17:43:44 -05:00
scripts Add device tag support to Prometheus metrics 2026-01-28 20:48:10 -05:00
tools/endpoint-discovery Restore tools/endpoint-discovery as optional Python tool 2026-01-30 21:22:17 -05:00
.cursorrules Add AI context files for major LLMs 2026-01-27 20:40:02 -05:00
.gitignore Restore tools/endpoint-discovery as optional Python tool 2026-01-30 21:22:17 -05:00
.golangci.yaml fix verify 2025-12-03 11:42:47 -06:00
.goreleaser.yaml fix(release): drop universal_binaries so homebrew_casks can find macOS archives 2026-05-09 11:55:18 -05:00
AGENTS.md Add AI context files for major LLMs 2026-01-27 20:40:02 -05:00
CLAUDE.md Add AI context files for major LLMs 2026-01-27 20:40:02 -05:00
CODE_OF_CONDUCT.md
CONTRIBUTING.md fix(release): drop universal_binaries so homebrew_casks can find macOS archives 2026-05-09 11:55:18 -05:00
Dockerfile chore(release): migrate goreleaser config off deprecated fields 2026-05-09 11:37:39 -05:00
LICENSE
Makefile
PR_REMOTE_API_FABRIC_FIX.md Fix remote API (Fabric/API key): 429 handling, NVR filter, updateWeb nil panic (#958) 2026-02-18 06:34:04 -05:00
README.md
go.mod fix(prometheus): serve scrapes from cached background poll (#1013) 2026-05-11 17:43:44 -05:00
go.sum fix(prometheus): serve scrapes from cached background poll (#1013) 2026-05-11 17:43:44 -05:00
main.go feat(otelunifi): add OpenTelemetry output plugin (#978) 2026-03-23 18:19:18 -05:00
settings.sh

README.md

discord grafana pulls stars

unifi

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 © 2018-2020 David Newhall II.
  • See LICENSE for license information.