mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
83dd1f0a16
It's also possible to do zpool IO from the MIB, but diskIO on LibreNMS makes a lot of assumptions about it coming from the UCD MIB. This changeset adds detection for FreeNAS and TrueNAS - despite having their own enterprise number, the snmpd uses the FreeBSD one. The naming is a bit all over the place, because this reflects reality - IXSystems produce FreeNAS and TrueNAS, the product lines have merged to eliminate FreeNAS, but TrueNAS still calls itself FreeNAS everywhere except the GUI.
22 lines
1.1 KiB
PHP
22 lines
1.1 KiB
PHP
<?php
|
|
|
|
$datasetTable_array = snmpwalk_cache_oid($device, 'datasetTable', null, 'FREENAS-MIB');
|
|
|
|
$sql = "SELECT `storage_descr` FROM `storage` WHERE `device_id` = '".$device['device_id']."' AND `storage_type` != 'dataset'";
|
|
$tmp_storage = dbFetchColumn($sql);
|
|
|
|
if (is_array($datasetTable_array)) {
|
|
foreach ($datasetTable_array as $index => $dataset) {
|
|
if (isset($dataset['datasetDescr'])) {
|
|
if (!in_array($dataset['datasetDescr'], $tmp_storage)) {
|
|
$dataset['datasetIndex'] = $index;
|
|
$dataset['datasetTotal'] = $dataset['datasetSize'] * $dataset['datasetAllocationUnits'];
|
|
$dataset['datasetAvail'] = ($dataset['datasetAvailable'] * $dataset['datasetAllocationUnits']);
|
|
$dataset['datasetUsed'] = $dataset['datasetTotal'] - $dataset['datasetAvail'];
|
|
|
|
discover_storage($valid_storage, $device, $dataset['datasetIndex'], 'dataset', 'freenas-dataset', $dataset['datasetDescr'], $dataset['datasetTotal'], $dataset['datasetAllocationUnits'], $dataset['datasetUsed']);
|
|
}
|
|
}
|
|
}
|
|
}
|