diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index ebba4d619c..233c7ed270 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2013-09-03 Miguel de Dios + + * include/functions_groups.php, operation/agentes/group_view.php: + fixed the links (now use constants instead the magic number and + unicorns) to the filtered list of modules. + 2013-09-03 Miguel de Dios * include/functions_api.php: fixed typing bugs...yes I wrote a lot diff --git a/pandora_console/include/functions_groups.php b/pandora_console/include/functions_groups.php index 019de8bd40..008cd4d701 100644 --- a/pandora_console/include/functions_groups.php +++ b/pandora_console/include/functions_groups.php @@ -741,42 +741,50 @@ function groups_get_group_row_data($id_group, $group_all, $group, &$printed_grou WHERE disabled = 0"); } - $row[__('Agents')] = ""; + $row[__('Agents')] = ""; $row[__('Agents')] .= $data["total_agents"]; $row[__('Agents')] .= ""; // Agents unknown - $row[__('Agents unknown')] = ""; + $row[__('Agents unknown')] = ""; $row[__('Agents unknown')] .= $data["agents_unknown"]; $row[__('Agents unknown')] .= ""; // Monitors Unknown - $row[__('Unknown')] = ""; + $row[__('Unknown')] = ""; $row[__('Unknown')] .= $data["monitor_unknown"]; $row[__('Unknown')] .= ""; // Monitors Not Init - $row[__('Not init')] = ""; + $row[__('Not init')] = ""; $row[__('Not init')] .= $data["monitor_not_init"]; $row[__('Not init')] .= ""; // Monitors OK - $row[__('Normal')] = ""; + $row[__('Normal')] = ""; $row[__('Normal')] .= $data["monitor_ok"]; $row[__('Normal')] .= ""; // Monitors Warning - $row[__('Warning')] = ""; + $row[__('Warning')] = ""; $row[__('Warning')] .= $data["monitor_warning"]; $row[__('Warning')] .= ""; // Monitors Critical - $row[__('Critical')] = ""; + $row[__('Critical')] = ""; $row[__('Critical')] .= $data["monitor_critical"]; $row[__('Critical')] .= ""; // Alerts fired - $row[__('Alerts fired')] = "";; + $row[__('Alerts fired')] = "";; $row[__('Alerts fired')] .= $data["monitor_alerts_fired"]; $row[__('Alerts fired')] .= ""; @@ -918,7 +926,7 @@ function groups_get_group_row($id_group, $group_all, $group, &$printed_groups) { if ($data["agents_unknown"] > 0) { echo ""; echo ""; + href='index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id=$id_group&status=" . AGENT_STATUS_UNKNOWN ."'>"; echo $data["agents_unknown"]; echo ""; echo ""; @@ -931,7 +939,8 @@ function groups_get_group_row($id_group, $group_all, $group, &$printed_groups) { if ($data["monitor_unknown"] > 0) { echo ""; echo ""; + href='index.php?" . + "sec=estado&sec2=operation/agentes/status_monitor&ag_group=$id_group&status=" . AGENT_MODULE_STATUS_UNKNOWN . "'>"; echo $data["monitor_unknown"]; echo ""; echo ""; @@ -945,7 +954,8 @@ function groups_get_group_row($id_group, $group_all, $group, &$printed_groups) { if ($data["monitor_not_init"] > 0) { echo ""; echo ""; + href='index.php?" . + "sec=estado&sec2=operation/agentes/status_monitor&ag_group=$id_group&status=" . AGENT_MODULE_STATUS_NOT_INIT . "'>"; echo $data["monitor_not_init"]; echo ""; echo ""; @@ -958,7 +968,9 @@ function groups_get_group_row($id_group, $group_all, $group, &$printed_groups) { // Monitors OK echo ""; if ($data["monitor_ok"] > 0) { - echo ""; + echo ""; echo $data["monitor_ok"]; echo ""; } @@ -971,7 +983,8 @@ function groups_get_group_row($id_group, $group_all, $group, &$printed_groups) { if ($data["monitor_warning"] > 0) { echo ""; echo ""; + href='index.php?" . + "sec=estado&sec2=operation/agentes/status_monitor&ag_group=$id_group&status=" . AGENT_MODULE_STATUS_WARNING . "'>"; echo $data["monitor_warning"]; echo ""; echo ""; @@ -984,7 +997,8 @@ function groups_get_group_row($id_group, $group_all, $group, &$printed_groups) { if ($data["monitor_critical"] > 0) { echo ""; echo ""; + href='index.php?" . + "sec=estado&sec2=operation/agentes/status_monitor&ag_group=$id_group&status=" . AGENT_MODULE_STATUS_CRITICAL_BAD . "'>"; echo $data["monitor_critical"]; echo ""; echo ""; @@ -996,7 +1010,8 @@ function groups_get_group_row($id_group, $group_all, $group, &$printed_groups) { if ($data["monitor_alerts_fired"] > 0) { echo ""; echo ""; + href='index.php?" . + "sec=estado&sec2=operation/agentes/alerts_status&ag_group=$id_group&filter=fired'>"; echo $data["monitor_alerts_fired"]; echo ""; echo ""; @@ -1010,7 +1025,7 @@ function groups_get_group_row($id_group, $group_all, $group, &$printed_groups) { $row[$id_group] = ob_get_clean(); - foreach($group['childs'] as $child) { + foreach ($group['childs'] as $child) { if (array_key_exists($child, $group_all)) { $row_child = groups_get_group_row($child, $group_all, $group_all[$child], $printed_groups); diff --git a/pandora_console/operation/agentes/group_view.php b/pandora_console/operation/agentes/group_view.php index e57b1d07b1..f6e41577af 100644 --- a/pandora_console/operation/agentes/group_view.php +++ b/pandora_console/operation/agentes/group_view.php @@ -48,7 +48,7 @@ if (isset ($_GET["update_netgroup"])) { $groups_full = users_get_groups ($config['id_user'], "AR", true, true); $groups = array(); -foreach($groups_full as $group) { +foreach ($groups_full as $group) { $groups[$group['id_grupo']]['name'] = $group['nombre']; if ($group['id_grupo'] != 0) { @@ -117,7 +117,7 @@ if (count($agents) > 0) { } $table_rows = array_slice($table_rows, $offset, $config['block_size']); - foreach($table_rows as $row) { + foreach ($table_rows as $row) { echo $row; }