Commit version 24.12.13800
This commit is contained in:
@ -4,9 +4,9 @@
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage discovery
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
|
||||
* @package observium
|
||||
* @subpackage discovery
|
||||
* @copyright (C) Adam Armstrong
|
||||
*
|
||||
*/
|
||||
|
||||
@ -17,14 +17,16 @@ include("includes/include-dir-mib.inc.php");
|
||||
|
||||
foreach (get_device_mibs_permitted($device) as $mib) {
|
||||
|
||||
if (!is_array($config['mibs'][$mib]['storage'])) { continue; }
|
||||
if (!is_array($config['mibs'][$mib]['storage'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
print_cli_data_field($mib);
|
||||
foreach ($config['mibs'][$mib]['storage'] as $entry_name => $entry) {
|
||||
discover_storage_definition($device, $mib, $entry, $entry_name);
|
||||
print_cli_data_field($mib);
|
||||
foreach ($config['mibs'][$mib]['storage'] as $entry_name => $entry) {
|
||||
discover_storage_definition($device, $mib, $entry, $entry_name);
|
||||
|
||||
}
|
||||
print_cli(PHP_EOL);
|
||||
}
|
||||
print_cli(PHP_EOL);
|
||||
}
|
||||
|
||||
print_debug_vars($valid['storage']);
|
||||
@ -32,20 +34,22 @@ print_debug_vars($valid['storage']);
|
||||
// Remove storage which weren't redetected here
|
||||
$query = 'SELECT * FROM `storage` WHERE `device_id` = ?';
|
||||
|
||||
foreach (dbFetchRows($query, array($device['device_id'])) as $test_storage) {
|
||||
$storage_index = $test_storage['storage_index'];
|
||||
$storage_mib = $test_storage['storage_mib'];
|
||||
$storage_descr = $test_storage['storage_descr'];
|
||||
print_debug($storage_index . " -> " . $storage_mib);
|
||||
foreach (dbFetchRows($query, [$device['device_id']]) as $test_storage) {
|
||||
$storage_index = $test_storage['storage_index'];
|
||||
$storage_mib = $test_storage['storage_mib'];
|
||||
$storage_descr = $test_storage['storage_descr'];
|
||||
print_debug($storage_index . " -> " . $storage_mib);
|
||||
|
||||
if (!$valid['storage'][$storage_mib][$storage_index]) {
|
||||
$GLOBALS['module_stats']['storage']['deleted']++; //echo('-');
|
||||
dbDelete('storage', 'storage_id = ?', [ $test_storage['storage_id'] ]);
|
||||
log_event("Storage removed: index $storage_index, mib $storage_mib, descr $storage_descr", $device, 'storage', $test_storage['storage_id']);
|
||||
}
|
||||
if (!$valid['storage'][$storage_mib][$storage_index]) {
|
||||
$GLOBALS['module_stats']['storage']['deleted']++; //echo('-');
|
||||
dbDelete('storage', 'storage_id = ?', [$test_storage['storage_id']]);
|
||||
log_event("Storage removed: index $storage_index, mib $storage_mib, descr $storage_descr", $device, 'storage', $test_storage['storage_id']);
|
||||
}
|
||||
}
|
||||
|
||||
$GLOBALS['module_stats'][$module]['status'] = safe_count($valid[$module]);
|
||||
if (OBS_DEBUG && $GLOBALS['module_stats'][$module]['status']) { print_vars($valid[$module]); }
|
||||
if (OBS_DEBUG && $GLOBALS['module_stats'][$module]['status']) {
|
||||
print_vars($valid[$module]);
|
||||
}
|
||||
|
||||
// EOF
|
||||
|
Reference in New Issue
Block a user