. * * @link https://www.librenms.org * @copyright 2017 Neil Lathwood * @copyright 2020 PipoCanaja * @author Neil Lathwood */ if ($device['os'] === 'vrp') { $vrp_tmp = snmpwalk_cache_oid($device, 'hwStorageEntry', null, 'HUAWEI-FLASH-MAN-MIB'); /* * array ( * 1 => * array ( * 'hwStorageType' => 'flash', * 'hwStorageSpace' => '206324', * 'hwStorageSpaceFree' => '59084', * 'hwStorageName' => 'flash:', * 'hwStorageDescr' => 'System Flash', * ), * ) */ if (is_array($vrp_tmp)) { echo 'storageEntry '; foreach ($vrp_tmp as $index => $storage) { $fstype = 'dsk'; $descr = $storage['hwStorageDescr']; if (empty($descr)) { $descr = $storage['hwStorageName']; } $units = 1024; if (is_numeric($storage['hwStorageSpace']) && is_numeric($storage['hwStorageSpaceFree'])) { $total = $storage['hwStorageSpace'] * $units; $used = $total - $storage['hwStorageSpaceFree'] * $units; discover_storage($valid_storage, $device, $index, $fstype, 'vrp', $descr, $total, $units, $used); } } } unset($vrp_tmp); }