Skip to content

TrueNAS

The TrueNAS adapter uses TrueNAS’s WebSocket JSON-RPC transport (TLS mandatory). This transport replaces the REST v2.0 API that was removed in TrueNAS SCALE 25.x/26.0. FreeSDN connects via the WS endpoint, polls pool, disk, and alert state on a configurable interval (default: every 5 minutes), and surfaces storage status in the unified dashboard.

FeatureDetails
ZFS pool healthOnline / degraded / faulted / unknown; RAIDZ1/2/3 + mirror topology
Disk temperaturesPer-disk temperature readings with threshold alerting
AlertsActive TrueNAS alert list (severity, message, klass) - dismissed alerts are filtered out at the adapter layer
Redundancy statusVdev status and hot-spare availability
Scrub statusIn-progress and last-completed scrub results
Health rollupAggregate OK/WARNING/CRITICAL rolled up to the dashboard
Staged blob writesWrite backup archives and config blobs to TrueNAS datasets via staging

TrueNAS SCALE 25.04+ (Fangtooth) and 26.0 expose a JSON-RPC 2.0 WebSocket endpoint at:

wss://<nas-host>/api/current

All communication is JSON-RPC over this WebSocket. TLS is mandatory - FreeSDN auto-revokes the API key if a ws:// (plaintext) connection is attempted. You cannot disable TLS enforcement for TrueNAS connections.

The adapter authenticates with an API key (preferred) or username/password. It opens a connection, reads health data, and closes the connection per polling cycle. There is no persistent connection and no reconnect/backoff loop - each polling pass is a discrete connect → authenticate → read → disconnect sequence.

:::

  • TrueNAS CORE 13.x or TrueNAS SCALE 22.12 or later
  • An API key created in TrueNAS (see below)
  • HTTPS (port 443) accessible from the FreeSDN host to the TrueNAS system
  1. Log in to the TrueNAS web UI.
  2. Top-right user menu → API Keys (SCALE) or System → API Keys (CORE).
  3. Click Add, name it freesdn, leave the allowed hosts blank (or restrict to the FreeSDN host IP), and click Save.
  4. Copy the generated key - it is shown only once.
Terminal window
# Add the TrueNAS system as a storage controller.
# Pass the API key as "password" - the adapter reads it from that field
# and presents it to TrueNAS as a Bearer token.
curl -X POST https://freesdn.example.com/api/v1/controllers \
-H "Cookie: freesdn_access=<token>" \
-H "X-CSRF-Token: <csrf>" \
-H "Content-Type: application/json" \
-d '{
"name": "TrueNAS S4",
"controller_type": "truenas",
"host": "https://nas.example.com",
"port": 443,
"username": "",
"password": "<truenas-api-key>",
"site_id": "<site-uuid>"
}'

FreeSDN opens a WebSocket connection per polling cycle (connect → authenticate → read → disconnect). Health data is visible on the dashboard after the first poll cycle completes (default interval: every 5 minutes).

The Storage dashboard card shows:

IndicatorMeaning
OK (green)All pools online; no active alerts; all disks within temperature thresholds
WARNING (amber)One or more pools degraded, or a disk is near temperature threshold, or a non-critical alert is active
CRITICAL (red)One or more pools faulted, or a disk has failed, or a critical TrueNAS alert is active

The hot-disk alert fires when a disk temperature exceeds the per-vendor threshold (typically 55°C for spinning disks, 70°C for SSDs). Thresholds are configurable in the FreeSDN site settings.

Health data is exposed through the Fabric catalog rather than dedicated REST routes. To query current pool status:

Terminal window
# Retrieve the full Fabric catalog (all modules - there is no server-side module filter)
curl https://freesdn.example.com/api/v1/fabric/catalog \
-H "Cookie: freesdn_access=<token>"

The catalog endpoint returns every operation and event across all modules in a single response. There is no ?module= query parameter - FastAPI would silently ignore it and still return the full catalog. Filter storage-related entries client-side by checking operation.module == "storage" (or the equivalent key) in the returned JSON.

For dashboard-style summary data, the main dashboard endpoint aggregates storage health across all controllers:

Terminal window
curl https://freesdn.example.com/api/v1/analytics/dashboard/summary \
-H "Cookie: freesdn_access=<token>"

The adapter supports writing backup archives and configuration blobs to TrueNAS datasets. This is used internally by:

  • The Backup module (camera snapshots, log batches, and other artifact blobs staged to TrueNAS datasets via storage.store_blob)
  • Fabric automation connections that route an artifact to TrueNAS

Blob writes go through the staging system - the write is recorded in FreeSDN’s pending-changes table and dispatched to TrueNAS only after an operator apply. This prevents accidental overwrites of backup datasets.

BehaviourCORE 13.xSCALE 23.x+
WebSocket endpointN/A (uses REST /api/v2.0/)wss://<host>/api/current
REST v2.0AvailableRemoved in 25.x
API key authAvailableAvailable
Pool status methodpool.querypool.query
Disk temp methodGET /api/v2.0/disk (REST, no temps)disk.temperatures (WS, 25.04+ only)
Alert methodN/A - REST transport, not availablealert.list (WS, 25.04+ only)

Disk temperatures and active alerts are only available on SCALE 25.04+ via the WebSocket JSON-RPC transport. On CORE 13.x (and SCALE ≤24.10), the adapter falls back to the REST v2.0 client, which has no equivalent endpoint for either feature - the dashboard cards for those fields are silently empty for those boxes.

  • ws:// is blocked - plaintext WebSocket connections auto-revoke the key. Always use https:// in the host field (the adapter derives wss:// from it automatically).
  • RAIDZ3 + hot-disk alert - the adapter has been live-verified against a RAIDZ3 system with a hot-disk alert. The alert surfaced correctly in the dashboard as WARNING within one polling cycle.
  • TrueNAS SCALE RDB format - TrueNAS SCALE uses a different RDB (boot pool) format than CORE. The adapter reads health state only; it does not interpret the boot pool. If the boot pool is degraded, the alert appears in the alert list but is not separately categorized.
  • Session model - The adapter opens a WebSocket connection per polling cycle (connect, authenticate, poll, disconnect) rather than holding a persistent session. Idle-timeout is not a concern because the connection is closed after each operation. The websockets client is configured with ping_interval=None - no background pings are sent.

The TrueNAS adapter is registered under the Storage module (storage), not as a Network or Compute adapter. It participates in the Fabric catalog and the backup pipeline but does not expose standalone HTTP REST routes. There is no separate frontend page - storage health is visible on the main dashboard.

All product names, logos, and brands are property of their respective owners. FreeSDN is an independent project and is not affiliated with or endorsed by the vendors it integrates with. See Trademarks.