From 92f163e8aed231501adab961480f21f3f2103234 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 7 Mar 2014 10:54:02 +0000 Subject: [PATCH] 2014-03-07 Miguel de Dios * operation/agentes/status_monitor.php, operation/agentes/estado_monitores.php: added the snapshot feature in the view of monitors. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9526 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 + .../operation/agentes/estado_monitores.php | 18 +- .../operation/agentes/status_monitor.php | 166 ++++++++++++------ 3 files changed, 129 insertions(+), 61 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index e33aea815f..2f62a933ff 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2014-03-07 Miguel de Dios + + * operation/agentes/status_monitor.php, + operation/agentes/estado_monitores.php: added the snapshot feature + in the view of monitors. + 2014-03-06 Miguel de Dios * include/functions_visual_map.php, diff --git a/pandora_console/operation/agentes/estado_monitores.php b/pandora_console/operation/agentes/estado_monitores.php index 0f1d311150..0348777b22 100644 --- a/pandora_console/operation/agentes/estado_monitores.php +++ b/pandora_console/operation/agentes/estado_monitores.php @@ -486,14 +486,22 @@ foreach ($modules as $module) { // If carriage returns present... then is a "Snapshot" data (full command output) $is_snapshot = is_snapshot_data ( $module_value ); - if (($config['command_snapshot']) && ($is_snapshot)){ - $handle = "snapshot"."_".$module["id_agente_modulo"]; - $url = 'include/procesos.php?agente='.$module["id_agente_modulo"]; + if (($config['command_snapshot']) && ($is_snapshot)) { + $handle = "snapshot" . "_" . $module["id_agente_modulo"]; + $url = 'include/procesos.php?agente=' . $module["id_agente_modulo"]; $win_handle = dechex(crc32($handle)); - $link ="winopeng_var('operation/agentes/snapshot_view.php?id=".$module["id_agente_modulo"]."&refr=".$module["current_interval"]."&label=".$module["nombre"]."','".$win_handle."', 700,480)"; + $link ="winopeng_var('operation/agentes/snapshot_view.php?" . + "id=" . $module["id_agente_modulo"] . + "&refr=" . $module["current_interval"] . + "&label=" . $module["nombre"] . "','".$win_handle."', 700,480)"; - $salida = '' . html_print_image("images/default_list.png", true, array("border" => '0', "alt" => "", "title" => __("Snapshot view"))) . '   '; + $salida = '' . + html_print_image("images/default_list.png", true, + array( + "border" => '0', + "alt" => "", + "title" => __("Snapshot view"))) . '   '; } else { //Fixed the goliat sends the strings from web diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index b81d81ffad..f3b01efdf7 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -302,19 +302,19 @@ if (defined('METACONSOLE')) { # Fix : only user tags have to be shown in these component $_tags = tags_get_user_tags(); - + if (!empty($_tags)) { - + foreach ($_tags as $_tag) { - + $tags_temp[]['name'] = $_tag; - + } - + } - + $rows_temp = db_get_all_rows_sql("SELECT distinct name FROM tmodule_group ORDER BY name"); @@ -497,11 +497,13 @@ switch ($sortField) { switch ($sort) { case 'up': $selectAgentNameUp = $selected; - $order = array('field' => 'tagente.nombre', 'order' => 'ASC'); + $order = array('field' => 'tagente.nombre', + 'order' => 'ASC'); break; case 'down': $selectAgentNameDown = $selected; - $order = array('field' => 'tagente.nombre', 'order' => 'DESC'); + $order = array('field' => 'tagente.nombre', + 'order' => 'DESC'); break; } break; @@ -509,11 +511,15 @@ switch ($sortField) { switch ($sort) { case 'up': $selectTypeUp = $selected; - $order = array('field' => 'tagente_modulo.id_tipo_modulo', 'order' => 'ASC'); + $order = array( + 'field' => 'tagente_modulo.id_tipo_modulo', + 'order' => 'ASC'); break; case 'down': $selectTypeDown = $selected; - $order = array('field' => 'tagente_modulo.id_tipo_modulo', 'order' => 'DESC'); + $order = array( + 'field' => 'tagente_modulo.id_tipo_modulo', + 'order' => 'DESC'); break; } break; @@ -521,11 +527,15 @@ switch ($sortField) { switch ($sort) { case 'up': $selectModuleNameUp = $selected; - $order = array('field' => 'tagente_modulo.nombre', 'order' => 'ASC'); + $order = array( + 'field' => 'tagente_modulo.nombre', + 'order' => 'ASC'); break; case 'down': $selectModuleNameDown = $selected; - $order = array('field' => 'tagente_modulo.nombre', 'order' => 'DESC'); + $order = array( + 'field' => 'tagente_modulo.nombre', + 'order' => 'DESC'); break; } break; @@ -533,11 +543,15 @@ switch ($sortField) { switch ($sort) { case 'up': $selectIntervalUp = $selected; - $order = array('field' => 'tagente_modulo.module_interval', 'order' => 'ASC'); + $order = array( + 'field' => 'tagente_modulo.module_interval', + 'order' => 'ASC'); break; case 'down': $selectIntervalDown = $selected; - $order = array('field' => 'tagente_modulo.module_interval', 'order' => 'DESC'); + $order = array( + 'field' => 'tagente_modulo.module_interval', + 'order' => 'DESC'); break; } break; @@ -545,11 +559,15 @@ switch ($sortField) { switch ($sort) { case 'up': $selectStatusUp = $selected; - $order = array('field' => 'tagente_estado.estado', 'order' => 'ASC'); + $order = array( + 'field' => 'tagente_estado.estado', + 'order' => 'ASC'); break; case 'down': $selectStatusDown = $selected; - $order = array('field' => 'tagente_estado.estado', 'order' => 'DESC'); + $order = array( + 'field' => 'tagente_estado.estado', + 'order' => 'DESC'); break; } break; @@ -557,11 +575,15 @@ switch ($sortField) { switch ($sort) { case 'up': $selectDataUp = $selected; - $order = array('field' => 'tagente_estado.datos', 'order' => 'ASC'); + $order = array( + 'field' => 'tagente_estado.datos', + 'order' => 'ASC'); break; case 'down': $selectDataDown = $selected; - $order = array('field' => 'tagente_estado.datos', 'order' => 'DESC'); + $order = array( + 'field' => 'tagente_estado.datos', + 'order' => 'DESC'); break; } break; @@ -569,11 +591,15 @@ switch ($sortField) { switch ($sort) { case 'up': $selectTimestampUp = $selected; - $order = array('field' => 'tagente_estado.utimestamp', 'order' => 'ASC'); + $order = array( + 'field' => 'tagente_estado.utimestamp', + 'order' => 'ASC'); break; case 'down': $selectTimestampDown = $selected; - $order = array('field' => 'tagente_estado.utimestamp', 'order' => 'DESC'); + $order = array( + 'field' => 'tagente_estado.utimestamp', + 'order' => 'DESC'); break; } break; @@ -592,7 +618,8 @@ switch ($sortField) { $selectDataDown = ''; $selectTimestampUp = ''; $selectTimestampDown = ''; - $order = array('field' => 'tagente.nombre', + $order = array( + 'field' => 'tagente.nombre', 'order' => 'ASC'); break; } @@ -966,14 +993,20 @@ foreach ($result as $row) { $data[3] .= ui_print_help_tip ($row["extended_info"], true, '/images/comments.png'); } if ($row["tags"] != "") { - $data[3] .= html_print_image('/images/tag_red.png', true, array('title' => $row["tags"], 'style' => 'width: 20px; margin-left: 3px;')); + $data[3] .= html_print_image('/images/tag_red.png', true, + array( + 'title' => $row["tags"], + 'style' => 'width: 20px; margin-left: 3px;')); } /* $data[4] = ui_print_truncate_text($row['tags'], 'agent_small', false, true, true, '[…]', 'font-size:7pt;'); */ - $data[5] = ($row['module_interval'] == 0) ? human_time_description_raw($row['agent_interval']) : human_time_description_raw($row['module_interval']); + $data[5] = ($row['module_interval'] == 0) ? + human_time_description_raw($row['agent_interval']) + : + human_time_description_raw($row['module_interval']); if ($row['utimestamp'] == 0 && (($row['module_type'] < 21 || $row['module_type'] > 23) && $row['module_type'] != 100)) { @@ -1060,46 +1093,67 @@ foreach ($result as $row) { $module_value = io_safe_output($row["datos"]); } - $sub_string = substr(io_safe_output($row["datos"]), 0, 12); - if ($module_value == $sub_string) { - $salida = $module_value; + $is_snapshot = is_snapshot_data ( $module_value ); + + if (($config['command_snapshot']) && ($is_snapshot)) { + $handle = "snapshot" . "_" . $row["id_agente_modulo"]; + $url = 'include/procesos.php?agente=' . $row["id_agente_modulo"]; + $win_handle = dechex(crc32($handle)); + + $link = "winopeng_var('operation/agentes/snapshot_view.php?" . + "id=" . $row["id_agente_modulo"] . + "&refr=" . $row["current_interval"] . + "&label=" . $row["nombre"] . "','" . $win_handle . "', 700,480)"; + + $salida = '' . + html_print_image("images/default_list.png", true, + array("border" => '0', + "alt" => "", + "title" => __("Snapshot view"))) . '   '; } else { - //Fixed the goliat sends the strings from web - //without HTML entities - if ($is_web_content_string) { - $sub_string = substr($row["datos"], 0, 12); - } - else { - //Fixed the data from Selenium Plugin - if ($module_value != strip_tags($module_value)) { - $module_value = io_safe_input($module_value); - $sub_string = substr($row["datos"], 0, 12); - } - else { - $sub_string = substr(io_safe_output($row["datos"]),0, 12); - } - } - - + $sub_string = substr(io_safe_output($row["datos"]), 0, 12); if ($module_value == $sub_string) { $salida = $module_value; } else { - $salida = "" . - $module_value . - "" . - "" . - '' . - $sub_string . ' ' . - "" . - html_print_image("images/rosette.png", true) . "" . ""; + //Fixed the goliat sends the strings from web + //without HTML entities + if ($is_web_content_string) { + $sub_string = substr($row["datos"], 0, 12); + } + else { + //Fixed the data from Selenium Plugin + if ($module_value != strip_tags($module_value)) { + $module_value = io_safe_input($module_value); + $sub_string = substr($row["datos"], 0, 12); + } + else { + $sub_string = substr(io_safe_output($row["datos"]),0, 12); + } + } + + + + if ($module_value == $sub_string) { + $salida = $module_value; + } + else { + $salida = "" . + $module_value . + "" . + "" . + '' . + $sub_string . ' ' . + "" . + html_print_image("images/rosette.png", true) . "" . ""; + } } } }