#10347 fixed urls monitors and added name group

This commit is contained in:
Daniel Cebrian 2023-03-02 16:22:25 +01:00
parent dc6256058f
commit af5a620883
4 changed files with 23 additions and 18 deletions

View File

@ -47,7 +47,7 @@ if (empty($id_group) === true) {
if (is_metaconsole() === false) {
// Header.
ui_print_standard_header(
__('View tactic'),
__(groups_get_name($id_group)),
'images/group.png',
false,
'',
@ -89,7 +89,7 @@ $table_col1->data = [];
$table_col1->rowclass[] = '';
$table_col1->headstyle[0] = 'text-align:center;';
$table_col1->width = '100%';
$table_col1->data[0][0] = groups_get_heat_map_agents($id_groups, 320, 100);
$table_col1->data[0][0] = groups_get_heat_map_agents($id_groups, 450, 100);
$table_col1->data[1][0] = tactical_groups_get_agents_and_monitoring($id_groups);
$distribution_by_so = '<table cellpadding=0 cellspacing=0 class="databox pies mrgn_top_15px" width=100%><tr><td style="width:50%;">';

View File

@ -5379,11 +5379,13 @@ function graph_so_by_group($id_group, $width=300, $height=200, $recursive=true,
$data[] = $row['count'];
}
if ($noWaterMark === false) {
if ($noWaterMark === true) {
$water_mark = [
'file' => $config['homedir'].'/images/logo_vertical_water.png',
'url' => ui_get_full_url('images/logo_vertical_water.png', false, false, false),
];
} else {
$water_mark = [];
}
$options = [
@ -5448,7 +5450,7 @@ function graph_events_agent_by_group($id_group, $width=300, $height=200, $noWate
'SELECT DISTINCT(id_agente) AS id_agente,
COUNT(id_agente) AS count
FROM tevento te
WHERE 1=1 AND estado = 0 %s %s
WHERE 1=1 %s %s
GROUP BY id_agente
ORDER BY count DESC LIMIT 8',
$tags_condition,
@ -5492,7 +5494,7 @@ function graph_events_agent_by_group($id_group, $width=300, $height=200, $noWate
// Sort the data.
arsort($data);
if ($noWaterMark) {
if ($noWaterMark === true) {
$water_mark = [
'file' => $config['homedir'].'/images/logo_vertical_water.png',
'url' => ui_get_full_url('images/logo_vertical_water.png', false, false, false),

View File

@ -2612,8 +2612,8 @@ function tactical_groups_get_agents_and_monitoring($id_groups)
// Link URLS
$urls = [];
$urls['total_agents'] = $config['homeurl'].'index.php?sec=estado&amp;sec2=operation/agentes/estado_agente&amp;refr=60';
$urls['monitor_total'] = $config['homeurl'].'index.php?sec=view&amp;sec2=operation/agentes/status_monitor&amp;refr=60&amp;status=-1';
$urls['total_agents'] = $config['homeurl'].'index.php?sec=estado&amp;sec2=operation/agentes/estado_agente&amp;refr=60&group_id='.$id_groups[0].'&recursion=1';
$urls['monitor_total'] = $config['homeurl'].'index.php?sec=view&amp;sec2=operation/agentes/status_monitor&amp;refr=60&amp;status=-1&ag_group='.$id_groups[0].'&recursion=1';
$table_am = html_get_predefined_table();
$tdata = [];
@ -2662,8 +2662,8 @@ function tactical_groups_get_stats_alerts($id_groups)
];
$urls = [];
$urls['monitor_alerts'] = $config['homeurl'].'index.php?sec=estado&amp;sec2=operation/agentes/alerts_status&amp;refr=60';
$urls['monitor_alerts_fired'] = $config['homeurl'].'index.php?sec=estado&amp;sec2=operation/agentes/alerts_status&amp;refr=60&disabled=fired';
$urls['monitor_alerts'] = $config['homeurl'].'index.php?sec=estado&amp;sec2=operation/agentes/alerts_status&amp;refr=60&ag_group='.$id_groups[0];
$urls['monitor_alerts_fired'] = $config['homeurl'].'index.php?sec=estado&amp;sec2=operation/agentes/alerts_status&amp;refr=60&disabled=fired&ag_group='.$id_groups[0];
// Alerts table.
$table_al = html_get_predefined_table();
@ -2732,11 +2732,11 @@ function groups_get_stats_modules_status($id_groups, $graph_width=250, $graph_he
// Link URLS.
if ($links === false) {
$urls = [];
$urls['monitor_critical'] = $config['homeurl'].'index.php?'.'sec=view&amp;sec2=operation/agentes/status_monitor&amp;'.'refr=60&amp;status='.AGENT_MODULE_STATUS_CRITICAL_BAD.'&pure='.$config['pure'].'&recursion=1&ag_group='.$id_group;
$urls['monitor_warning'] = $config['homeurl'].'index.php?'.'sec=view&amp;sec2=operation/agentes/status_monitor&amp;'.'refr=60&amp;status='.AGENT_MODULE_STATUS_WARNING.'&pure='.$config['pure'].'&recursion=1&ag_group='.$id_group;
$urls['monitor_ok'] = $config['homeurl'].'index.php?'.'sec=view&amp;sec2=operation/agentes/status_monitor&amp;'.'refr=60&amp;status='.AGENT_MODULE_STATUS_NORMAL.'&pure='.$config['pure'].'&recursion=1&ag_group='.$id_group;
$urls['monitor_unknown'] = $config['homeurl'].'index.php?'.'sec=view&amp;sec2=operation/agentes/status_monitor&amp;'.'refr=60&amp;status='.AGENT_MODULE_STATUS_UNKNOWN.'&pure='.$config['pure'].'&recursion=1&ag_group='.$id_group;
$urls['monitor_not_init'] = $config['homeurl'].'index.php?'.'sec=view&amp;sec2=operation/agentes/status_monitor&amp;'.'refr=60&amp;status='.AGENT_MODULE_STATUS_NOT_INIT.'&pure='.$config['pure'].'&recursion=1&ag_group='.$id_group;
$urls['monitor_critical'] = $config['homeurl'].'index.php?'.'sec=view&amp;sec2=operation/agentes/status_monitor&amp;'.'refr=60&amp;status='.AGENT_MODULE_STATUS_CRITICAL_BAD.'&pure='.$config['pure'].'&recursion=1&ag_group='.$id_groups[0];
$urls['monitor_warning'] = $config['homeurl'].'index.php?'.'sec=view&amp;sec2=operation/agentes/status_monitor&amp;'.'refr=60&amp;status='.AGENT_MODULE_STATUS_WARNING.'&pure='.$config['pure'].'&recursion=1&ag_group='.$id_groups[0];
$urls['monitor_ok'] = $config['homeurl'].'index.php?'.'sec=view&amp;sec2=operation/agentes/status_monitor&amp;'.'refr=60&amp;status='.AGENT_MODULE_STATUS_NORMAL.'&pure='.$config['pure'].'&recursion=1&ag_group='.$id_groups[0];
$urls['monitor_unknown'] = $config['homeurl'].'index.php?'.'sec=view&amp;sec2=operation/agentes/status_monitor&amp;'.'refr=60&amp;status='.AGENT_MODULE_STATUS_UNKNOWN.'&pure='.$config['pure'].'&recursion=1&ag_group='.$id_groups[0];
$urls['monitor_not_init'] = $config['homeurl'].'index.php?'.'sec=view&amp;sec2=operation/agentes/status_monitor&amp;'.'refr=60&amp;status='.AGENT_MODULE_STATUS_NOT_INIT.'&pure='.$config['pure'].'&recursion=1&ag_group='.$id_groups[0];
} else {
$urls = [];
$urls['monitor_critical'] = $links['monitor_critical'];

View File

@ -486,7 +486,7 @@ class Group extends Entity
include_once $config['homedir'].'/include/functions_graph.php';
$out = '<div style="flex: 0 0 300px; width:99%; height:100%;">';
$out .= graph_so_by_group($id_group);
$out .= graph_so_by_group($id_group, 300, 200, false, false);
$out .= '<div>';
echo $out;
return;
@ -500,7 +500,7 @@ class Group extends Entity
include_once $config['homedir'].'/include/functions_graph.php';
$out = '<div style="flex: 0 0 300px; width:99%; height:100%;">';
$out .= graph_events_agent_by_group($id_group, 300, 200, true, true);
$out .= graph_events_agent_by_group($id_group, 300, 200, false, true, true);
$out .= '<div>';
echo $out;
return;
@ -633,7 +633,8 @@ class Group extends Entity
}
$sql = sprintf(
'SELECT alias,
'SELECT id_agente,
alias,
critical_count,
warning_count,
unknown_count,
@ -654,7 +655,9 @@ class Group extends Entity
$data = db_get_all_rows_sql($sql);
$sql = sprintf(
'SELECT alias,
'SELECT
id_agente,
alias,
critical_count,
warning_count,
unknown_count,