diff --git a/pandora_console/operation/agentes/group_view.php b/pandora_console/operation/agentes/group_view.php index 204f7d937e..08066014e0 100644 --- a/pandora_console/operation/agentes/group_view.php +++ b/pandora_console/operation/agentes/group_view.php @@ -175,182 +175,7 @@ if ($total_agentes > 0) { $total_not_init = format_numeric((($agents_notinit * 100) / $total_agentes), 2); } -$all_group_id = []; -foreach ($result_groups as $group) { - if ($group['_id_'] !== '0') { - $all_group_id[] = $group['_id_']; - } -} - -$out = ''; -$out .= ''; -$out .= ''; -$out .= ''; -$out .= ''; -$out .= ''; -$out .= ''; -$out .= ''; -$out .= ''; - -$description = ''; -$odd = false; -$graph_width = 180; -$graph_height = 200; - -foreach ($result_groups as $group) { - if ($group['_id_'] !== '0') { - $description = db_get_value('description', 'tgrupo', 'id_grupo', $group['_id_']); - $icon_url = db_get_value('icon', 'tgrupo', 'id_grupo', $group['_id_']); - $icon = html_print_image( - 'images/'.$icon_url, - true, - [ - 'title' => $group['_name_'], - 'class' => 'main_menu_icon invert_filter', - ] - ); - - $where_event = 'WHERE te.id_grupo = '.$group['_id_']; - $where_os = 'WHERE ta.id_grupo = '.$group['_id_']; - } else { - $description = __('Data view of all groups'); - $icon = ''; - $where_event = 'WHERE te.id_grupo in ('.implode(', ', $all_group_id).')'; - $where_os = 'WHERE ta.id_grupo in ('.implode(', ', $all_group_id).')'; - } - - $group_events = db_get_all_rows_sql( - 'SELECT COUNT(te.id_evento) as count_events, ta.alias - FROM tevento as te - INNER JOIN tagente as ta ON te.id_agente = ta.id_agente '.$where_event.' GROUP BY te.id_agente' - ); - - $group_os = db_get_all_rows_sql( - 'SELECT COUNT(os.name) as count_os, os.name as name_os, ta.id_grupo - FROM tconfig_os as os - INNER JOIN tagente as ta ON ta.id_os = os.id_os '.$where_os.' GROUP by os.name' - ); - - if ($odd === false) { - $out .= ''; - } - - $out .= ''; - $out .= ''; - - if ($odd === true) { - $out .= ''; - $odd = false; - } else { - $odd = true; - } -} - -$out .= ''; -$out .= ''; -$out .= ''; -$out .= '
'.__('Summary of the status groups').'
'; - $out .= '
- '.$group['_name_'].'   '.$icon.''; - - $out .= ''; - $out .= ''; - $out .= ''; - - $out .= ''; - $out .= ''; - $out .= ''; - $out .= ''; - $out .= ''; - $out .= ''; - $out .= ''; - $out .= ''; - $out .= ''; - $out .= ''; - $out .= ''; - $out .= '
-
- '.__('Description').''.$description.'
-
'; - if ($group['_id_'] === '0') { - $out .= tactical_groups_get_stats_alerts($all_group_id); - } else { - $out .= tactical_groups_get_stats_alerts($group['_id_']); - } - - $out .= '
'; - if ($group['_id_'] === '0') { - $out .= tactical_groups_get_agents_and_monitoring($all_group_id); - } else { - $out .= tactical_groups_get_agents_and_monitoring($group['_id_']); - } - - $out .= ''; - if ($group['_id_'] === '0') { - $out .= groups_get_stats_modules_status($all_group_id); - } else { - $out .= groups_get_stats_modules_status($group['_id_']); - } - - $out .= '
'.__('Events per agent').''; - - $data = []; - $options = []; - $labels = []; - foreach ($group_events as $value) { - $data[$value['alias']] = $value['count_events']; - $labels[] = io_safe_output($value['alias']); - } - - $options = [ - 'width' => $graph_width, - 'height' => $graph_height, - 'legend' => ['display' => false], - 'labels' => $labels, - ]; - - $out .= '
'.'
'.pie_graph($data, $options).'
'; - $out .= '
'; - $out .= '
'.__('Distribution by so').''; - - $data = []; - $options = []; - $labels = []; - foreach ($group_os as $value) { - $data[$value['name_os']] = $value['count_os']; - $labels[] = io_safe_output($value['name_os']); - } - - $options = [ - 'width' => $graph_width, - 'height' => $graph_height, - 'legend' => ['display' => false], - 'labels' => $labels, - ]; - - $out .= '
'.'
'.pie_graph($data, $options).'
'; - $out .= '
'; - $out .= '
'; - - if (!isset($data['_is_tag_']) && check_acl($config['id_user'], $data['_id_'], 'AW')) { - $out .= ''.html_print_image( - 'images/force@svg.svg', - true, - [ - 'border' => '0', - 'title' => __('Force'), - 'class' => 'main_menu_icon invert_filter', - ] - ).''; - } - - $out .= '
'; - $out .= '
'; - $out .= '
'; - -echo $out; -/* - echo ''; +echo '
'; echo ''; echo ''; echo "'; @@ -378,15 +203,15 @@ echo $out; echo ''; echo ''; echo ''; - echo '
".__('Summary of the status groups').'
'; +echo ''; - if ($count == 1) { +if ($count == 1) { if ($result_groups[0]['_id_'] == 0) { unset($result_groups[0]); } - } +} - if (empty($result_groups) === false) { +if (empty($result_groups) === false) { $pagination = ui_pagination( $count, false, @@ -534,10 +359,10 @@ echo $out; echo ""; if (isset($data['_is_tag_'])) { $link = ""; + href='index.php?sec=monitoring&sec2=operation/tree&tag_id=".$data['_id_']."'>"; } else { - $link = ""; + $link = ""; } if ($data['_id_'] == 0) { @@ -554,10 +379,10 @@ echo $out; echo ""; if (isset($data['_is_tag_'])) { $link = ""; + href='index.php?sec=monitoring&sec2=operation/tree&tag_id=".$data['_id_'].'&status='.AGENT_STATUS_UNKNOWN."'>"; } else { - $link = ""; + $link = ""; } if (($data['_id_'] == 0) && ($agents_unknown != 0)) { @@ -574,10 +399,10 @@ echo $out; echo ""; if (isset($data['_is_tag_'])) { $link = ""; + href='index.php?sec=monitoring&sec2=operation/tree&tag_id=".$data['_id_'].'&status='.AGENT_STATUS_NOT_INIT."'>"; } else { - $link = ""; + $link = ""; } if (($data['_id_'] == 0) && ($agents_notinit != 0)) { @@ -594,10 +419,10 @@ echo $out; echo ""; if (isset($data['_is_tag_'])) { $link = ""; + href='index.php?sec=monitoring&sec2=operation/tree&tag_id=".$data['_id_'].'&status='.AGENT_STATUS_NORMAL."'>"; } else { - $link = ""; + $link = ""; } if (($data['_id_'] == 0) && ($agents_ok != 0)) { @@ -614,10 +439,10 @@ echo $out; echo ""; if (isset($data['_is_tag_'])) { $link = ""; + href='index.php?sec=monitoring&sec2=operation/tree&tag_id=".$data['_id_'].'&status='.AGENT_STATUS_WARNING."'>"; } else { - $link = ""; + $link = ""; } if (($data['_id_'] == 0) && ($agents_warning != 0)) { @@ -634,10 +459,10 @@ echo $out; echo ""; if (isset($data['_is_tag_'])) { $link = ""; + href='index.php?sec=monitoring&sec2=operation/tree&tag_id=".$data['_id_'].'&status='.AGENT_STATUS_CRITICAL."'>"; } else { - $link = ""; + $link = ""; } if (($data['_id_'] == 0) && ($agents_critical != 0)) { @@ -653,11 +478,11 @@ echo $out; // Monitors unknown echo ""; if (!isset($data['_is_tag_'])) { - $link = ""; + $link = ""; } else { - $link = ""; + $link = ""; } if (($data['_id_'] == 0) && ($monitor_unknown != 0)) { @@ -673,11 +498,11 @@ echo $out; // Monitors not init echo ""; if (!isset($data['_is_tag_'])) { - $link = ""; + $link = ""; } else { - $link = ""; + $link = ""; } if (($data['_id_'] == 0) && ($monitor_not_init != 0)) { @@ -693,11 +518,11 @@ echo $out; // Monitors OK echo ""; if (!isset($data['_is_tag_'])) { - $link = ""; + $link = ""; } else { - $link = ""; + $link = ""; } if (($data['_id_'] == 0) && ($monitor_ok != 0)) { @@ -713,11 +538,11 @@ echo $out; // Monitors Warning echo ""; if (!isset($data['_is_tag_'])) { - $link = ""; + $link = ""; } else { - $link = ""; + $link = ""; } if (($data['_id_'] == 0) && ($monitor_warning != 0)) { @@ -733,11 +558,11 @@ echo $out; // Monitors Critical echo ""; if (!isset($data['_is_tag_'])) { - $link = ""; + $link = ""; } else { - $link = ""; + $link = ""; } if (($data['_id_'] == 0) && ($monitor_critical != 0)) { @@ -753,11 +578,11 @@ echo $out; // Alerts fired echo ""; if (!isset($data['_is_tag_'])) { - $link = ""; + $link = ""; } else { - $link = ""; + $link = ""; } if (($data['_id_'] == 0) && ($all_alerts_fired != 0)) { @@ -774,7 +599,6 @@ echo $out; } echo ''; - } else { +} else { ui_print_info_message(__('There are no defined agents')); - } -*/ +}