Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move ignore_storage call to discover_storage #7973

Merged
merged 2 commits into from Jan 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions includes/discovery/functions.inc.php
Expand Up @@ -577,6 +577,9 @@ function discover_link($local_port_id, $protocol, $remote_port_id, $remote_hostn

function discover_storage(&$valid, $device, $index, $type, $mib, $descr, $size, $units, $used = null)
{
if (ignore_storage($device['os'], $descr)) {
return;
}
d_echo("Discover Storage: $index, $type, $mib, $descr, $size, $units, $used\n");

if ($descr && $size > '0') {
Expand Down
21 changes: 0 additions & 21 deletions includes/discovery/storage/netapp-storage.inc.php
Expand Up @@ -18,27 +18,6 @@
$used = ($storage['dfKBytesUsed'] * $units);
}

foreach (Config::get('ignore_mount', array()) as $bi) {
if ($bi == $descr) {
d_echo("$bi == $descr \n");
continue;
}
}

foreach (Config::get('ignore_mount_string', array()) as $bi) {
if (strpos($descr, $bi) !== false) {
d_echo("strpos: $descr, $bi \n");
continue;
}
}

foreach (Config::get('ignore_mount_regexp', array()) as $bi) {
if (preg_match($bi, $descr) > '0') {
d_echo("preg_match $bi, $descr \n");
continue;
}
}

if (is_numeric($index)) {
discover_storage($valid_storage, $device, $index, $fstype, 'netapp-storage', $descr, $size, $units, $used);
}
Expand Down
4 changes: 1 addition & 3 deletions includes/discovery/storage/ucd-dsktable.inc.php
Expand Up @@ -13,9 +13,7 @@
$dsk['dskAvail'] = ($entry['dskAvail'] * 1024);
$dsk['dskUsed'] = $dsk['dskTotal'] - $dsk['dskAvail'];

if (ignore_storage($device['os'], $dsk['dskPath']) != 1) {
discover_storage($valid_storage, $device, $dsk['dskIndex'], 'dsk', 'ucd-dsktable', $dsk['dskPath'], $dsk['dskTotal'], 1024, $dsk['dskUsed']);
}
discover_storage($valid_storage, $device, $dsk['dskIndex'], 'dsk', 'ucd-dsktable', $dsk['dskPath'], $dsk['dskTotal'], 1024, $dsk['dskUsed']);
}
}
}
Expand Down