Dashboard
About 1422 words
unifi dashboard shows the state of a site on one screen: health, internet, traffic, clients, devices and events. On a terminal it's a full-screen view that refreshes itself; in a pipe it draws one frame and exits.
$ unifi dashboard --once --widget health --widget internet
UniFi Network demo · Default updated 16:16:54 v10.0.160 1 pending 1 update ✗ 1 offline
╭─ Health ─────────────────────────────── 1 degraded ─╮ ╭─ Internet ────────────────────────────── ● online ─╮
│ ● Internet Nordlicht Fiber │ │ ISP Nordlicht Fiber │
│ ● WAN 1 gateway · 46 clients │ │ Public IP 203.0.113.42 │
│ ● LAN 3 switches · 22 clients │ │ Latency 4 ms · 0% loss │
│ ▲ WiFi 3 of 4 APs · 24 clients │ │ Speed test ↓ 943 Mbps ↑ 471 Mbps │
│ ● VPN 1 client │ │ Throughput ↓ 170 Mbps ↑ 28.2 Mbps │
│ │ │ Availability █████████████████████████████ 99.98% │
╰─────────────────────────────────────────────────────╯ ╰─────────────────────────── WAN · 1 failover ready ─╯The header line names the context and site, the time of the last refresh and the controller version, and it counts what needs attention: devices pending adoption, firmware updates, and offline devices.
The interactive view
unifi dashboard
unifi dashboard --refresh 2sFocusing and zooming the traffic widget, the Topology and Events tabs, three presses of t for the next theme, and the help overlay.
The view has three tabs. Overview shows your widgets, Topology draws the site as in unifi topology, and Events shows the system log at full height.
| Key | Action |
|---|---|
| 1 2 3 | Switch to Overview, Topology, Events |
| tab / shift+tab | Focus the next or previous widget; the focused panel is marked with ▸ |
| arrow keys | Move the focus; scroll the topology or the events |
| pgup / pgdn / space | Scroll a page. On the Overview tab this pages through the rows when the layout is taller than the terminal |
| enter | Zoom the focused widget to the full screen, and back |
| r | Refresh now |
| s | Switch site |
| t | Next theme |
| c | Toggle dark and light |
| a | Events: switch between relative and absolute times |
| v | Topology: show or hide clients |
| l | Topology: cycle the layout |
| ? | Show the keys |
| esc | Close an overlay or the zoom; quit |
| q / ctrl+c | Quit |
A panel that has more rows than it can show says so in its border (+3 more), and zooming it shows the rest. On a terminal that is too short for the whole layout, the Overview tab becomes pages instead of cutting rows off.
What the header tells you
The dashboard opens at once, drawn from the snapshot of the last run, and the header says so: cached 2m ago · refreshing. Fresh data replaces it panel by panel as the controller answers. After that the right end of the footer shows the refresh state: the interval, refreshing while a refresh is under way, paused while the terminal window isn't focused, and throttled, next refresh in 30s when the controller rate-limits and the dashboard backs off.
With colorScheme: auto the view follows your terminal when it switches between its light and dark appearance.
If the controller can't be reached when the dashboard starts, an error screen explains why; r tries again and q quits.
t and c change the look for the running session only. To keep a theme, select it with unifi theme use.
Zooming is worth trying on the traffic and devices widgets: a widget that shows six rows in its panel shows everything when it has the screen to itself.
One frame
unifi dashboard --once # a single frame, also on a terminal
unifi dashboard | less -R # a pipe gets a single frame anyway
unifi dashboard --once --widget traffic --widget clients--once is what you want in a login banner, a tmux status pane with watch, or a bug report. --widget limits the frame to the widget types you name, in one row, and can be repeated.
--watch does the opposite: it insists on the full-screen view and fails when the output isn't a terminal, which makes a misconfigured script fail loudly instead of printing frames into a log.
The data behind it
unifi dashboard --output json | jq '.stats'With --output json or yaml, the command prints the data the widgets draw from instead of drawing them, and --widget narrows that to the data of the named widgets: context, site, controller, stats, devices, clients, events, cloud and fetchedAt. That's one request-efficient way to feed a status bar or an exporter.
Customize the layout
The dashboard is built from rows of widgets, configured under preferences.dashboard in the configuration file. Open it with unifi config edit.
preferences:
dashboard:
refresh: 10s
rows:
- widgets:
- type: health
- type: wans
span: 2
- height: 12
widgets:
- type: traffic
span: 3
options:
range: live
- type: top-clients
title: Heaviest clients
span: 2
options:
limit: 8
by: usage
- widgets:
- type: ports
span: 2
options:
device: Core Switch
- type: poe
- type: networks
options:
limit: 6
- widgets:
- type: events
title: Security events
span: 3
options:
limit: 8
category: security
- type: text
title: On call
options:
content: |
Fiber outage: call the ISP first,
then check `unifi events get --category system`.
tone: mutedThis layout is part of examples/config.yaml, which you can try against the demo controller without touching your own configuration.
The rules are few:
rowsrun top to bottom, and thewidgetsof a row run left to right.spanis a widget's share of the row's width relative to its neighbors. In a row with spans 3 and 2, the first widget gets three fifths. It defaults to 1.heightfixes a row's height in terminal lines. Leave it out and the widgets decide.titlereplaces the widget's default title.optionsare specific to the widget type.refreshis the interval between refreshes as a duration (5s,1m);--refreshoverrides it for one run.
If rows is empty or missing, the default layout applies: health, internet and ISP on top, traffic and clients below, then top clients, top access points and air view, then devices and events. unifi config init writes that default into a commented starter file as a base for your own.
An unknown widget type doesn't break the dashboard: its panel shows the mistake, suggests the closest valid type and lists the others, while the rest of the layout renders as usual.
The widgets
unifi dashboard --list-widgets prints this catalog from the binary.
| Type | Shows | Options |
|---|---|---|
health | State of every subsystem (Internet, WAN, LAN, WiFi, VPN) with device and client counts | |
internet | The active WAN: ISP, public IP, latency, packet loss, uptime, last speed test, current throughput | |
isp | ISP connectivity over 24 hours: latency graph, uptime, packet loss | |
traffic | The site's throughput as a mirrored area graph, download above and upload below the baseline | range |
clients | Connected clients over 24 hours with the wired, WiFi, guest and VPN breakdown | |
top-clients | Clients ranked by current throughput or by total usage | limit, by |
top-aps | Access points ranked by connected clients, with their WiFi experience | limit |
air-view | Channel utilization heatmap, one row per access point and one column per band | |
devices | Compact device table: state, name, uptime, clients, CPU and memory meters | |
events | Recent events with severity marks, newest first | limit, category, time, offset |
wans | All internet connections with failover state, latency, loss, uptime and throughput | |
poe | PoE power delivered per switch | |
networks | Clients per network | limit |
wifi-experience | Distribution of wireless clients' experience scores | |
top-apps | Applications ranked by traffic, as identified by the gateway | limit |
ports | Faceplate of one switch | device |
text | Static text from the configuration | content, tone |
The widget reference lists every option with its default.
Two widgets depend on where the data comes from. isp uses Site Manager metrics for cloud contexts and the gateway's own measurements otherwise. top-apps needs traffic identification enabled on the gateway.
Tips
Put the dashboard on a wall display with a read-only API key, a dedicated context and a slow refresh:
unifi --context wallboard dashboard --refresh 30s --theme monoEach refresh is a handful of API requests. A refresh interval of one or two seconds against a small gateway, or through the cloud connector, is a good way to meet the rate limiter; five seconds and up is fine.
