2020-04-27 16:23:44 +01:00
|
|
|
<?php
|
|
|
|
|
2023-07-25 09:37:23 +09:30
|
|
|
if ($device['os'] == 'truenas') {
|
|
|
|
$zpooltable_array = snmpwalk_cache_oid($device, 'zpoolTable', null, 'FREENAS-MIB');
|
2020-04-27 16:23:44 +01:00
|
|
|
|
2023-07-25 09:37:23 +09:30
|
|
|
if (is_array($zpooltable_array)) {
|
|
|
|
foreach ($zpooltable_array as $index => $zpool) {
|
2023-11-01 23:00:58 -05:00
|
|
|
// new devices return a status string at zpoolAllocationUnits (.1.3.6.1.4.1.50536.1.1.1.1.3) and no longer support zpool usage stats
|
|
|
|
if (is_numeric($zpool['zpoolAllocationUnits'])) {
|
|
|
|
$units = (int) $zpool['zpoolAllocationUnits'];
|
2020-04-27 16:23:44 +01:00
|
|
|
|
2023-11-01 23:00:58 -05:00
|
|
|
discover_storage($valid_storage, $device,
|
|
|
|
$index,
|
|
|
|
'zpool',
|
|
|
|
'freenas-zpool',
|
|
|
|
$zpool['zpoolDescr'],
|
|
|
|
$zpool['zpoolSize'] * $units,
|
|
|
|
$units,
|
|
|
|
$zpool['zpoolUsed'] * $units,
|
|
|
|
);
|
2020-04-27 16:23:44 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|