mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
Added the fixed of commit 'Fixed calculation of group items in visual maps on linked maps.'
This commit is contained in:
parent
23503831cd
commit
59bc138be4
@ -1916,34 +1916,78 @@ function visual_map_get_layout_status ($id_layout = 0, $depth = 0) {
|
|||||||
|
|
||||||
$id_layout = (int) $id_layout;
|
$id_layout = (int) $id_layout;
|
||||||
|
|
||||||
$result = db_get_all_rows_filter ('tlayout_data', array ('id_layout' => $id_layout),
|
$result = db_get_all_rows_filter ('tlayout_data',
|
||||||
array ('id_agente_modulo', 'parent_item', 'id_layout_linked', 'id_agent', 'type'));
|
array ('id_layout' => $id_layout),
|
||||||
|
array (
|
||||||
|
'id_agente_modulo',
|
||||||
|
'id_group',
|
||||||
|
'parent_item',
|
||||||
|
'id_layout_linked',
|
||||||
|
'id_agent',
|
||||||
|
'type'));
|
||||||
if ($result === false)
|
if ($result === false)
|
||||||
return VISUAL_MAP_STATUS_NORMAL;
|
return VISUAL_MAP_STATUS_NORMAL;
|
||||||
|
|
||||||
foreach ($result as $rownum => $data) {
|
foreach ($result as $data) {
|
||||||
if (($data["id_layout_linked"] == 0 && $data["id_agente_modulo"] == 0 && $data["id_agent"] == 0) || $data['type'] != 0)
|
switch ($data['type']) {
|
||||||
continue;
|
case GROUP_ITEM:
|
||||||
// Other Layout (Recursive!)
|
if (($data["id_layout_linked"] == 0) {
|
||||||
if (($data["id_layout_linked"] != 0) && ($data["id_agente_modulo"] == 0)) {
|
$group_status = groups_get_status($data['id_group']);
|
||||||
$status = visual_map_get_layout_status ($data["id_layout_linked"], $depth);
|
switch ($group_status) {
|
||||||
|
case AGENT_STATUS_ALERT_FIRED:
|
||||||
|
$status = VISUAL_MAP_STATUS_CRITICAL_ALERT;
|
||||||
|
break;
|
||||||
|
case AGENT_STATUS_CRITICAL:
|
||||||
|
$status = VISUAL_MAP_STATUS_CRITICAL_BAD;
|
||||||
|
break;
|
||||||
|
case AGENT_STATUS_WARNING:
|
||||||
|
$status = VISUAL_MAP_STATUS_WARNING;
|
||||||
|
break;
|
||||||
|
case AGENT_STATUS_UNKNOWN:
|
||||||
|
$status = VISUAL_MAP_STATUS_UNKNOWN;
|
||||||
|
break;
|
||||||
|
case AGENT_STATUS_NORMAL:
|
||||||
|
default:
|
||||||
|
$status = VISUAL_MAP_STATUS_NORMAL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$status = visual_map_get_layout_status(
|
||||||
|
$data["id_layout_linked"], $depth);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (($data["id_layout_linked"] == 0 &&
|
||||||
|
$data["id_agente_modulo"] == 0 &&
|
||||||
|
$data["id_agent"] == 0) ||
|
||||||
|
$data['type'] != 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// Other Layout (Recursive!)
|
||||||
|
if (($data["id_layout_linked"] != 0) && ($data["id_agente_modulo"] == 0)) {
|
||||||
|
$status = visual_map_get_layout_status($data["id_layout_linked"], $depth);
|
||||||
|
}
|
||||||
|
// Module
|
||||||
|
elseif ($data["id_agente_modulo"] != 0) {
|
||||||
|
$status = modules_get_agentmodule_status($data["id_agente_modulo"]);
|
||||||
|
|
||||||
|
}
|
||||||
|
// Agent
|
||||||
|
else {
|
||||||
|
//--------------------------------------------------
|
||||||
|
// ADDED NO CHECK ACL FOR AVOID CHECK TAGS THAT
|
||||||
|
// MAKE VERY SLOW THE VISUALMAPS WITH ACL TAGS
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
|
$status = agents_get_status($data["id_agent"], true);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
// Module
|
|
||||||
elseif ($data["id_agente_modulo"] != 0) {
|
|
||||||
$status = modules_get_agentmodule_status ($data["id_agente_modulo"]);
|
|
||||||
|
|
||||||
}
|
|
||||||
// Agent
|
|
||||||
else {
|
|
||||||
//--------------------------------------------------
|
|
||||||
// ADDED NO CHECK ACL FOR AVOID CHECK TAGS THAT
|
|
||||||
// MAKE VERY SLOW THE VISUALMAPS WITH ACL TAGS
|
|
||||||
//--------------------------------------------------
|
|
||||||
|
|
||||||
$status = agents_get_status ($data["id_agent"], true);
|
|
||||||
}
|
|
||||||
if ($status == VISUAL_MAP_STATUS_CRITICAL_BAD)
|
if ($status == VISUAL_MAP_STATUS_CRITICAL_BAD)
|
||||||
return VISUAL_MAP_STATUS_CRITICAL_BAD;
|
return VISUAL_MAP_STATUS_CRITICAL_BAD;
|
||||||
|
|
||||||
if ($status > $temp_total)
|
if ($status > $temp_total)
|
||||||
$temp_total = $status;
|
$temp_total = $status;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user