Unifi Fabric
Structural health monitoring for a UniFi fabric. The @sntxrr/unifi-fabric/topology model's check method compares a declared topology against live /stat/device rows and reports the failures that outcome-based monitoring cannot see: a device expected on the wire that has silently fallen back to a wireless mesh uplink, attachment to the wrong upstream device, links negotiated below their expected speed, ports carrying error counters, and — the one with no equivalent elsewhere — ports that are down but have carried real traffic before, which identifies a run that used to work. The first three are detectors and gate inSync; error counters and dark ports are cumulative totals rather than rates, so both are reported as diagnostics and deliberately do not, since a single snapshot cannot tell a severed run from a client that went to sleep. An access point that loses its wired uplink does not fail; it meshes, keeps serving clients, and every uptime check stays green while latency quietly goes from sub-millisecond to tens of milliseconds and jittery. uplink.type flipping from wire to wireless is a boolean, so it is asserted exactly rather than thresholded. Read-only: never writes to the controller. Emits a flat Prometheus-ready metric series alongside the verdict, including for healthy devices, so alerts can fire on a series dropping to zero rather than on a document changing shape. Authenticates with an API key over X-API-KEY, which sidesteps the HTTP 499 that MFA-enabled SSO accounts return for password logins.
Declare SPDX license (MIT) in manifest.
Global Arguments
| Argument | Type | Description |
|---|---|---|
| host | string | UniFi OS console IP or hostname, e.g. 192.0.2.1 |
| apiKey | string | API key issued under Settings → Control Plane → Integrations (use a |
| site? | string | UniFi site name |
| links? | array | How each device should be attached. Used by `check` when the call |
| ports? | array | Ports whose speed is worth asserting. Used by `check` when the call |
| Argument | Type | Description |
|---|---|---|
| links? | array | How each device should be attached to the fabric. Defaults to the |
| ports? | array | Switch ports whose speed is worth asserting. Defaults to the |
| darkPortByteThreshold? | number | Bytes a down port must have carried before it is reported as a run |
Resources
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License2/2earned
- Verified public repository2/2earned