librenms-librenms/includes/discovery/storage/netapp-storage.inc.php
Tony Murray 773ee96240 refactor: Restrict storage discovery walks to os (#8528)
leave hrstorage and ucd unrestricted
Not sure on the ilo, but I think linux and windows servers can return data
2018-04-09 13:54:14 +01:00

30 lines
1.0 KiB
PHP

<?php
use LibreNMS\Config;
if ($device['os'] == 'netapp') {
$netapp_storage = snmpwalk_cache_oid($device, 'dfEntry', null, 'NETAPP-MIB');
if (is_array($netapp_storage)) {
echo 'dfEntry ';
foreach ($netapp_storage as $index => $storage) {
$fstype = $storage['dfType'];
$descr = $storage['dfFileSys'];
$units = 1024;
if (isset($storage['df64TotalKBytes']) && is_numeric($storage['df64TotalKBytes'])) {
$size = ($storage['df64TotalKBytes'] * $units);
$used = ($storage['df64UsedKBytes'] * $units);
} else {
$size = ($storage['dfKBytesTotal'] * $units);
$used = ($storage['dfKBytesUsed'] * $units);
}
if (is_numeric($index)) {
discover_storage($valid_storage, $device, $index, $fstype, 'netapp-storage', $descr, $size, $units, $used);
}
unset($deny, $fstype, $descr, $size, $used, $units, $storage_rrd, $old_storage_rrd, $hrstorage_array);
}
}
}