diff --git a/pandora_console/include/class/Networkmap.class.php b/pandora_console/include/class/Networkmap.class.php index a5a8a579d4..8cb3f6ac55 100644 --- a/pandora_console/include/class/Networkmap.class.php +++ b/pandora_console/include/class/Networkmap.class.php @@ -432,12 +432,6 @@ class Networkmap extends Map { unlink($filename_dot); unlink($filename_plain); // ----- END DEPRECATED CODE-------------------------------- - - switch (get_class($this)) { - case 'NetworkmapEnterprise': - NetworkmapEnterprise::dbSaveNodes(); - break; - } } } diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index a729a043c7..256333e21a 100755 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -2240,4 +2240,57 @@ function modules_get_first_contact_date($id_agent_module) { return $first_date; } + +function modules_get_module_group_status($id_agent, $id_module_group) { + $status_return = null; + + + $modules = db_get_all_rows_filter('tagente_modulo', + array('id_agente' => $id_agent, + 'id_module_group' => $id_module_group)); + + if (empty($modules)) + $module = array(); + + foreach ($modules as $module) { + $status = modules_get_status($module['id_agente_modulo']); + + // This code is copied from the networkmap old code + switch ($status) { + case AGENT_MODULE_STATUS_NORMAL: + if (is_null($status_return)) { + $status_return = AGENT_MODULE_STATUS_NORMAL; + } + elseif ($status_return == AGENT_MODULE_STATUS_ALL) { + $status_return = AGENT_MODULE_STATUS_NORMAL; + } + break; + case AGENT_MODULE_STATUS_CRITICAL_BAD: + $status_return = AGENT_MODULE_STATUS_CRITICAL_BAD; + break; + case AGENT_MODULE_STATUS_WARNING: + if (is_null($status_return)) { + $status_return = AGENT_MODULE_STATUS_NORMAL; + } + elseif ($status_return != AGENT_MODULE_STATUS_CRITICAL_BAD) { + $status_return = AGENT_MODULE_STATUS_WARNING; + } + break; + case AGENT_MODULE_STATUS_NO_DATA: + if (is_null($status_return)) { + $status_return = AGENT_MODULE_STATUS_NO_DATA; + } + elseif (($status_return == AGENT_MODULE_STATUS_NORMAL) || + ($status_return == AGENT_MODULE_STATUS_ALL)) { + $status_return = AGENT_MODULE_STATUS_NO_DATA; + } + break; + default: + $status_return = AGENT_MODULE_STATUS_ALL; + break; + } + } + + return $status_return; +} ?>