Process inventory modules with correct xml and empty data

This commit is contained in:
Calvo 2023-03-10 15:14:43 +01:00
parent 0cfe85770f
commit e2297171cb
4 changed files with 5 additions and 12 deletions

View File

@ -756,10 +756,8 @@ function inventory_get_datatable(
foreach ($rows as $row) { foreach ($rows as $row) {
$data_rows = explode(PHP_EOL, $row['data']); $data_rows = explode(PHP_EOL, $row['data']);
foreach ($data_rows as $data_key => $data_value) { foreach ($data_rows as $data_key => $data_value) {
if (empty($data_value) === false) { $row['data'] = $data_value;
$row['data'] = $data_value; $modules[$row['name']][$row['name_agent'].'-'.$data_key.'-'.$data_value] = $row;
$modules[$row['name']][$row['name_agent'].'-'.$data_key.'-'.$data_value] = $row;
}
} }
} }

View File

@ -169,7 +169,7 @@ foreach ($rows as $row) {
} }
if ($idModuleInventory != $row['id_module_inventory']) { if ($idModuleInventory != $row['id_module_inventory']) {
if (isset($table) === true && $rowTable > 1) { if (isset($table) === true && $rowTable >= 1) {
html_print_table($table); html_print_table($table);
unset($table); unset($table);
$rowTable = 1; $rowTable = 1;
@ -271,7 +271,7 @@ foreach ($rows as $row) {
$idModuleInventory = $row['id_module_inventory']; $idModuleInventory = $row['id_module_inventory'];
} }
if (isset($table) === true && $rowTable > 1) { if (isset($table) === true && $rowTable >= 1) {
html_print_table($table); html_print_table($table);
$printedTables++; $printedTables++;
} }

View File

@ -1457,10 +1457,6 @@ if ($tab == 'inventory') {
$inventorytab['active'] = false; $inventorytab['active'] = false;
} }
$inventorytab = enterprise_hook('inventory_tab');
if ($inventorytab === ENTERPRISE_NOT_HOOK || $inventoryCount === 0) {
$inventorytab = '';
}
// Collection. // Collection.
if ((int) $config['license_nms'] !== 1) { if ((int) $config['license_nms'] !== 1) {

View File

@ -7232,7 +7232,6 @@ sub process_inventory_data ($$$$$$$) {
} }
} }
next if ($data_list eq '');
process_inventory_module_data ($pa_config, $data_list, $server_id, $agent_name, $module_name, $interval, $timestamp, $dbh); process_inventory_module_data ($pa_config, $data_list, $server_id, $agent_name, $module_name, $interval, $timestamp, $dbh);
} }
} }