From 927561e32fa971a0d457ab9c08759539692d968c Mon Sep 17 00:00:00 2001 From: juanmanuelr Date: Wed, 23 Nov 2011 16:26:17 +0000 Subject: [PATCH] 2011-11-23 Juan Manuel Ramon * operation/agentes/estado_agente.php: Added agent description in this view. Fixes: # 3424337 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5158 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 ++ .../operation/agentes/estado_agente.php | 67 ++++++++++++------- 2 files changed, 48 insertions(+), 26 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 815d49b64d..3281e098c8 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2011-11-23 Juan Manuel Ramon + + * operation/agentes/estado_agente.php: Added agent description in + this view. + + Fixes: # 3424337 + 2011-11-23 Juan Manuel Ramon * godmode/agentes/agent_conf_gis.php diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index 589f0a8362..1ef3bf21a6 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -287,7 +287,8 @@ if (! empty ($agent_names)) { 'id_grupo', 'id_os', 'ultimo_contacto', - 'intervalo'), + 'intervalo', + 'comentarios description'), 'AR', $order); } @@ -309,30 +310,42 @@ $table->head = array (); $table->head[0] = __('Agent'). ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp, "alt" => "up")) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown, "alt" => "down")) . ''; -$table->head[1] = __('OS'). ' ' . +$table->head[1] = __('Description'); +$table->head[2] = __('OS'). ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectOsUp, "alt" => "up")) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectOsDown, "alt" => "down")) . ''; -$table->head[2] = __('Interval'). ' ' . +$table->head[3] = __('Interval'). ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectIntervalUp, "alt" => "up")) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectIntervalDown, "alt" => "down")) . ''; -$table->head[3] = __('Group'). ' ' . +$table->head[4] = __('Group'). ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectGroupUp, "alt" => "up")) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectGroupDown, "alt" => "down")) . ''; -$table->head[4] = __('Modules'); -$table->head[5] = __('Status'); -$table->head[6] = __('Alerts'); -$table->head[7] = __('Last contact'). ' ' . +$table->head[5] = __('Modules'); +$table->head[6] = __('Status'); +$table->head[7] = __('Alerts'); +$table->head[8] = __('Last contact'). ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectLastContactUp, "alt" => "up")) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectLastContactDown, "alt" => "down")) . ''; $table->align = array (); -$table->align[1] = "center"; $table->align[2] = "center"; $table->align[3] = "center"; $table->align[4] = "center"; $table->align[5] = "center"; $table->align[6] = "center"; -$table->align[7] = "right"; +$table->align[7] = "center"; +$table->align[8] = "right"; + +$table->style = array(); +$table->style[0] = 'width: 9%'; +$table->style[1] = 'width: 11%'; +$table->style[2] = 'width: 7%'; +$table->style[3] = 'width: 10%'; +$table->style[4] = 'width: 9%'; +$table->style[5] = 'width: 10%'; +$table->style[6] = 'width: 6%'; +$table->style[7] = 'width: 6%'; +$table->style[8] = 'width: 15%'; $table->data = array (); @@ -370,7 +383,9 @@ foreach ($agents as $agent) { $data[0] .= ' '; }*/ - $data[1] = ui_print_os_icon ($agent["id_os"], false, true); + $data[1] = ui_print_truncate_text($agent["description"], 30, false, true, true, '[…]', 'font-size: 6.5pt'); + + $data[2] = ui_print_os_icon ($agent["id_os"], false, true); //The interval we are thinking that it must be the agent interval in this //cell and it'snt the interval of modules. @@ -379,39 +394,39 @@ foreach ($agents as $agent) { // } else { // $data[2] = $agent["intervalo"]; // } - $data[2] = $agent["intervalo"]; + $data[3] = $agent["intervalo"]; - $data[3] = ui_print_group_icon ($agent["id_grupo"], true); + $data[4] = ui_print_group_icon ($agent["id_grupo"], true); - $data[4] = ''; - $data[4] .= $agent_info["modules"]; + $data[5] = ''; + $data[5] .= $agent_info["modules"]; if ($agent_info["monitor_alertsfired"] > 0) - $data[4] .= ' : '.$agent_info["monitor_alertsfired"].''; + $data[5] .= ' : '.$agent_info["monitor_alertsfired"].''; if ($agent_info["monitor_critical"] > 0) - $data[4] .= ' : '.$agent_info["monitor_critical"].''; + $data[5] .= ' : '.$agent_info["monitor_critical"].''; if ($agent_info["monitor_warning"] > 0) - $data[4] .= ' : '.$agent_info["monitor_warning"].''; + $data[5] .= ' : '.$agent_info["monitor_warning"].''; if ($agent_info["monitor_unknown"] > 0) - $data[4] .= ' : '.$agent_info["monitor_unknown"].''; + $data[5] .= ' : '.$agent_info["monitor_unknown"].''; if ($agent_info["monitor_normal"] > 0) - $data[4] .= ' : '.$agent_info["monitor_normal"].''; - $data[4] .= ''; + $data[5] .= ' : '.$agent_info["monitor_normal"].''; + $data[5] .= ''; - $data[5] = $agent_info["status_img"]; + $data[6] = $agent_info["status_img"]; - $data[6] = $agent_info["alert_img"]; + $data[7] = $agent_info["alert_img"]; $last_time = strtotime ($agent["ultimo_contacto"]); $now = time (); $diferencia = $now - $last_time; - $time = ui_print_timestamp ($last_time, true); + $time = ui_print_timestamp ($last_time, true, array('style' => 'font-size:6.5pt')); $style = ''; if ($diferencia > ($agent["intervalo"] * 2)) - $data[7] = ''.$time.''; + $data[8] = ''.$time.''; else - $data[7] = $time; + $data[8] = $time; // This old code was returning "never" on agents without modules, BAD !! // And does not print outdated agents in red. WRONG !!!!