mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
25 lines
921 B
PHP
25 lines
921 B
PHP
<?php
|
|
|
|
$dsktable_array = snmpwalk_cache_oid($device, 'dskTable', null, 'UCD-SNMP-MIB');
|
|
|
|
$sql = "SELECT `storage_descr` FROM `storage` WHERE `device_id` = '".$device['device_id']."' AND `storage_type` != 'dsk'";
|
|
$tmp_storage = dbFetchColumn($sql);
|
|
|
|
if (is_array($dsktable_array)) {
|
|
foreach ($dsktable_array as $dsk) {
|
|
if (isset($dsk['dskPath'])) {
|
|
if (!in_array($dsk['dskPath'], $tmp_storage)) {
|
|
$dsk['dskTotal'] = $dsk['dskTotal'] * 1024;
|
|
$dsk['dskAvail'] = ($entry['dskAvail'] * 1024);
|
|
$dsk['dskUsed'] = $dsk['dskTotal'] - $dsk['dskAvail'];
|
|
|
|
$deny = ignore_storage($dsk['dskPath']);
|
|
|
|
if ($deny != 1) {
|
|
discover_storage($valid_storage, $device, $dsk['dskIndex'], 'dsk', 'ucd-dsktable', $dsk['dskPath'], $dsk['dskTotal'], 1024, $dsk['dskUsed']);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|