TrueNAS Scale 25.x broken SNMP - LibreNMS

Hello.

I am having an issue with multiple TrueNAS Scale NAS servers after the upgrade to 25.04 (Fangtooth)

On version 24.xx everything was working fine.

The issue is that Storage is not properly detected, Zpool status is reporting that is downgraded and there are no mount points listed in storage section. All of this was working perfectly fine with 24.xx

The output of configurations :

librenms@ubuntu:~$ ./validate.php

Component Version
LibreNMS 25.10.0-dev.59+f7ae9821a (2025-10-10T01:34:06+04:00)
DB Schema 2025_09_17_101816_add_timestamp_indexes_to_device_outages_table (356)
PHP 8.3.25
Python 3.10.12
Database MariaDB 10.6.22-MariaDB-0ubuntu0.22.04.1
RRDTool 1.7.2
SNMP 5.9.1
===========================================

[OK] Composer Version: 2.8.12
[OK] Dependencies up-to-date.
[OK] Database Connected
[OK] Database Schema is current
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK] Database and column collations are correct
[OK] Database schema correct
[OK] MySQL and PHP time match
[OK] Active pollers found
[OK] Dispatcher Service is enabled
[OK] Locks are functional
[OK] Python wrapper cron entry is not present
[OK] Redis is unavailable
[OK] rrdtool version ok
[OK] Connected to rrdcached

Output of /opt/librenms/logs/librenms.log :

[2025-10-10T10:31:44][CRITICAL] Exception: TypeError LibreNMS\Util\Number::fillMissingRatio(): Argument #6 ($multiplier) must be of type int|float, string given, called in /opt/librenms/app/Models/Storage.php on line 41 @ /opt/librenms/LibreNMS/Util/Number.php:310
#0 /opt/librenms/app/Models/Storage.php(41): LibreNMS\Util\Number::fillMissingRatio()
#1 /opt/librenms/LibreNMS/OS/Traits/YamlStorageDiscovery.php(62): App\Models\Storage->fillUsage()
#2 [internal function]: LibreNMS\OS->LibreNMS\OS\Traits{closure}()
#3 /opt/librenms/LibreNMS/Discovery/YamlDiscoveryDefinition.php(165): call_user_func()
#4 /opt/librenms/LibreNMS/OS/Traits/YamlStorageDiscovery.php(70): LibreNMS\Discovery\YamlDiscoveryDefinition->discover()
#5 /opt/librenms/LibreNMS/OS/Truenas.php(13): LibreNMS\OS->discoverYamlStorage()
#6 /opt/librenms/LibreNMS/Modules/Storage.php(61): LibreNMS\OS\Truenas->discoverStorage()
#7 /opt/librenms/includes/discovery/storage.inc.php(9): LibreNMS\Modules\Storage->discover()
#8 /opt/librenms/includes/discovery/functions.inc.php(171): include(‘…’)
#9 /opt/librenms/discovery.php(107): discover_device()
#10 {main}

I wrote a small script that did the analysis.

Librenms is still fetching data as it was but multiple things got broken with TrueNAS scale update on their side.

TrueNAS Scale 25.04 (Fangtooth) - LibreNMS Storage Discovery Issues

Summary

TrueNAS Scale 25.04 (Fangtooth) introduced breaking changes to the SNMP MIB implementation that cause multiple issues with LibreNMS storage discovery and monitoring.

Environment

  • TrueNAS Scale Version: 25.04.2.4 (Fangtooth)
  • LibreNMS Version: 25.10.0-dev.59+f7ae9821a
  • OS: Ubuntu 22.04 LTS
  • SNMP Version: v2c
  • MIB: FREENAS-MIB

Issue #1: Storage Discovery TypeError (CRITICAL) :white_check_mark: FIXED

Symptoms

  • Storage discovery fails completely
  • No zpools detected in LibreNMS interface
  • Error in logs: TypeError: Argument #6 ($multiplier) must be of type int|float, string given
  • Storage tab shows “Storage downgraded” or empty

Root Cause

TrueNAS Scale 24.xx (Working):

FREENAS-MIB::zpoolAllocationUnits.1 = 1024
FREENAS-MIB::zpoolAllocationUnits.2 = 1024

TrueNAS Scale 25.04 (Broken):

FREENAS-MIB::zpoolAllocationUnits.1 = "ONLINE"
FREENAS-MIB::zpoolAllocationUnits.2 = "ONLINE"

The OID .1.3.6.1.4.1.50536.1.1.1.1.3 (zpoolAllocationUnits) now returns the pool status string instead of a numeric allocation unit size.

Technical Details

Location: /opt/librenms/app/Models/Storage.php
Method: fillUsage()
Line: 41

The method passes $this->storage_units directly to Number::fillMissingRatio() which expects int|float as the 6th parameter ($multiplier). When TrueNAS returns “ONLINE”, this causes a TypeError.

Solution Implemented

Added validation in Storage.php line 38-44:

public function fillUsage($used = null, $total = null, $free = null, $percent = null): self
{
    // Handle non-numeric multipliers (TrueNAS 25.04 returns "ONLINE" instead of numeric units)
    $multiplier = $this->storage_units;
    if (!is_numeric($multiplier) || $multiplier == 0) {
        // If units is not numeric or zero, default to 1 to use raw values
        // This handles cases where zpoolAllocationUnits contains status strings like "ONLINE"
        $multiplier = 1;
    }

    try {
        [$this->storage_size, $this->storage_used, $this->storage_free, $this->storage_perc]
            = Number::fillMissingRatio($total, $used, $free, $percent, 0, $multiplier);
    } catch (InsufficientDataException $e) {
        Log::debug($e->getMessage());
        return $this;
    }

    return $this;
}

Results After Fix

:white_check_mark: Storage discovery completes without errors
:white_check_mark: Storage items appear in LibreNMS interface:

  • / (root filesystem)
  • /mnt/.ix-apps/docker
  • /mnt/.ix-apps/truenas_catalog
  • /mnt/.ix-apps/app_configs
  • /mnt/.ix-apps/app_mounts

Status: :white_check_mark: FIXED - Patch working successfully


Issue #2: ZPool Health State Incorrect (CRITICAL) :cross_mark: UNFIXED

Symptoms

  • ZPool state sensors show “Unknown” instead of “Online”
  • State monitoring non-functional
  • Cannot detect pool degradation or failures

Root Cause

Expected Values (FREENAS-MIB definition):

zpoolHealth:
  0 = online
  1 = degraded
  2 = faulted
  3 = offline
  4 = unavail
  5 = removed

TrueNAS Scale 24.xx (Working):

FREENAS-MIB::zpoolHealth.1 = 0
FREENAS-MIB::zpoolHealth.2 = 0

TrueNAS Scale 25.04 (Broken):

FREENAS-MIB::zpoolHealth.1 = 2489339904
FREENAS-MIB::zpoolHealth.2 = 9524469760

The OID .1.3.6.1.4.1.50536.1.1.1.1.7 (zpoolHealth) now returns random/corrupted large integer values instead of the documented state enum (0-5).

SNMP Query Results

$ snmpwalk -v2c -c COMMUNITY 192.168.120.206 .1.3.6.1.4.1.50536.1.1.1.1.7
iso.3.6.1.4.1.50536.1.1.1.1.7.1 = Counter64: 2489339904
iso.3.6.1.4.1.50536.1.1.1.1.7.2 = Counter64: 9524469760

Impact

  • :cross_mark: Pool health monitoring non-functional
  • :cross_mark: Cannot detect degraded pools
  • :cross_mark: Cannot detect faulted drives
  • :cross_mark: State sensors show “Unknown”
  • :cross_mark: Alerting for pool issues broken

Status: :cross_mark: UNFIXED - Requires TrueNAS fix or LibreNMS workaround


Discovery Output Comparison

TrueNAS Scale 24.xx (Working)

zpoolIndex.1 = 1
zpoolIndex.2 = 2
zpoolDescr.1 = "BACKUP1"
zpoolDescr.2 = "boot-pool"
zpoolAllocationUnits.1 = 1024          ← Numeric
zpoolAllocationUnits.2 = 1024          ← Numeric
zpoolSize.1 = 10177
zpoolSize.2 = 13266
zpoolUsed.1 = 18151
zpoolUsed.2 = 2112
zpoolAvailable.1 = 54689792
zpoolAvailable.2 = 294092800
zpoolHealth.1 = 0                       ← Valid enum
zpoolHealth.2 = 0                       ← Valid enum

TrueNAS Scale 25.04 (Broken)

zpoolIndex.1 = 1
zpoolIndex.2 = 2
zpoolDescr.1 = "BACKUP1"
zpoolDescr.2 = "boot-pool"
zpoolAllocationUnits.1 = "ONLINE"      ← String! (FIXED)
zpoolAllocationUnits.2 = "ONLINE"      ← String! (FIXED)
zpoolSize.1 = 10177
zpoolSize.2 = 13266
zpoolUsed.1 = 18151
zpoolUsed.2 = 2112
zpoolAvailable.1 = 54689792
zpoolAvailable.2 = 294092800
zpoolHealth.1 = 2489339904             ← Corrupted! (UNFIXED)
zpoolHealth.2 = 9524469760             ← Corrupted! (UNFIXED)

Affected OIDs

OID Name Expected Type 24.xx Returns 25.04 Returns Status
.1.3.6.1.4.1.50536.1.1.1.1.3.x zpoolAllocationUnits INTEGER 1024 “ONLINE” :white_check_mark: FIXED
.1.3.6.1.4.1.50536.1.1.1.1.7.x zpoolHealth INTEGER (0-5) 0 2489339904 :cross_mark: UNFIXED

Files Modified

LibreNMS Patch

  • File: /opt/librenms/app/Models/Storage.php
  • Lines Changed: 38-44 (6 lines added)
  • Impact: Minimal - only affects the fillUsage() method
  • Backward Compatible: Yes - works with both 24.xx and 25.04

Testing & Verification

Test Environment

  • Multiple TrueNAS Scale 25.04.2.4 servers
  • LibreNMS 25.10.0-dev.59
  • SNMP v2c monitoring

Verification Commands

# 1. Verify patch applied
grep -A 5 "Handle non-numeric multipliers" /opt/librenms/app/Models/Storage.php

# 2. Test storage discovery
php /opt/librenms/discovery.php -h TRUENAS_IP -m storage

# 3. Check SNMP values
snmpwalk -v2c -c COMMUNITY TRUENAS_IP .1.3.6.1.4.1.50536.1.1.1.1.3  # Allocation units
snmpwalk -v2c -c COMMUNITY TRUENAS_IP .1.3.6.1.4.1.50536.1.1.1.1.7  # Health

Have you posted a bug report on this?
If you do, please post back with the ticket number.

I did not. but I will research my way how to do it properly.
Just not sure yet in which category does it fit?

If you use the built-in Send Feedback button, that also includes a Bug report section, you should not need to pick a category, AFAIK. It’s available from the top menu inside the TrueNAS GUI.

You will need a Jira account though.