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
Forum Thread: TrueNAS Scale 25.04 (Fangtooth) 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)
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
Storage discovery completes without errors
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:
FIXED - Patch working successfully
Issue #2: ZPool Health State Incorrect (CRITICAL)
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
Pool health monitoring non-functional
Cannot detect degraded pools
Cannot detect faulted drives
State sensors show âUnknownâ
Alerting for pool issues broken
Status:
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â |
FIXED |
.1.3.6.1.4.1.50536.1.1.1.1.7.x |
zpoolHealth |
INTEGER (0-5) |
0 |
2489339904 |
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