2014-03-07 Miguel de Dios <miguel.dedios@artica.es>

* 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
This commit is contained in:
mdtrooper 2014-03-07 10:54:02 +00:00
parent 2c97d2c57c
commit 92f163e8ae
3 changed files with 129 additions and 61 deletions

View File

@ -1,3 +1,9 @@
2014-03-07 Miguel de Dios <miguel.dedios@artica.es>
* 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 <miguel.dedios@artica.es> 2014-03-06 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_visual_map.php, * include/functions_visual_map.php,

View File

@ -486,14 +486,22 @@ foreach ($modules as $module) {
// If carriage returns present... then is a "Snapshot" data (full command output) // If carriage returns present... then is a "Snapshot" data (full command output)
$is_snapshot = is_snapshot_data ( $module_value ); $is_snapshot = is_snapshot_data ( $module_value );
if (($config['command_snapshot']) && ($is_snapshot)){ if (($config['command_snapshot']) && ($is_snapshot)) {
$handle = "snapshot"."_".$module["id_agente_modulo"]; $handle = "snapshot" . "_" . $module["id_agente_modulo"];
$url = 'include/procesos.php?agente='.$module["id_agente_modulo"]; $url = 'include/procesos.php?agente=' . $module["id_agente_modulo"];
$win_handle = dechex(crc32($handle)); $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 = '<a href="javascript:'.$link.'">' . html_print_image("images/default_list.png", true, array("border" => '0', "alt" => "", "title" => __("Snapshot view"))) . '</a> &nbsp;&nbsp;'; $salida = '<a href="javascript:'.$link.'">' .
html_print_image("images/default_list.png", true,
array(
"border" => '0',
"alt" => "",
"title" => __("Snapshot view"))) . '</a> &nbsp;&nbsp;';
} }
else { else {
//Fixed the goliat sends the strings from web //Fixed the goliat sends the strings from web

View File

@ -302,19 +302,19 @@ if (defined('METACONSOLE')) {
# Fix : only user tags have to be shown in these component # Fix : only user tags have to be shown in these component
$_tags = tags_get_user_tags(); $_tags = tags_get_user_tags();
if (!empty($_tags)) { if (!empty($_tags)) {
foreach ($_tags as $_tag) { foreach ($_tags as $_tag) {
$tags_temp[]['name'] = $_tag; $tags_temp[]['name'] = $_tag;
} }
} }
$rows_temp = db_get_all_rows_sql("SELECT distinct name $rows_temp = db_get_all_rows_sql("SELECT distinct name
FROM tmodule_group FROM tmodule_group
ORDER BY name"); ORDER BY name");
@ -497,11 +497,13 @@ switch ($sortField) {
switch ($sort) { switch ($sort) {
case 'up': case 'up':
$selectAgentNameUp = $selected; $selectAgentNameUp = $selected;
$order = array('field' => 'tagente.nombre', 'order' => 'ASC'); $order = array('field' => 'tagente.nombre',
'order' => 'ASC');
break; break;
case 'down': case 'down':
$selectAgentNameDown = $selected; $selectAgentNameDown = $selected;
$order = array('field' => 'tagente.nombre', 'order' => 'DESC'); $order = array('field' => 'tagente.nombre',
'order' => 'DESC');
break; break;
} }
break; break;
@ -509,11 +511,15 @@ switch ($sortField) {
switch ($sort) { switch ($sort) {
case 'up': case 'up':
$selectTypeUp = $selected; $selectTypeUp = $selected;
$order = array('field' => 'tagente_modulo.id_tipo_modulo', 'order' => 'ASC'); $order = array(
'field' => 'tagente_modulo.id_tipo_modulo',
'order' => 'ASC');
break; break;
case 'down': case 'down':
$selectTypeDown = $selected; $selectTypeDown = $selected;
$order = array('field' => 'tagente_modulo.id_tipo_modulo', 'order' => 'DESC'); $order = array(
'field' => 'tagente_modulo.id_tipo_modulo',
'order' => 'DESC');
break; break;
} }
break; break;
@ -521,11 +527,15 @@ switch ($sortField) {
switch ($sort) { switch ($sort) {
case 'up': case 'up':
$selectModuleNameUp = $selected; $selectModuleNameUp = $selected;
$order = array('field' => 'tagente_modulo.nombre', 'order' => 'ASC'); $order = array(
'field' => 'tagente_modulo.nombre',
'order' => 'ASC');
break; break;
case 'down': case 'down':
$selectModuleNameDown = $selected; $selectModuleNameDown = $selected;
$order = array('field' => 'tagente_modulo.nombre', 'order' => 'DESC'); $order = array(
'field' => 'tagente_modulo.nombre',
'order' => 'DESC');
break; break;
} }
break; break;
@ -533,11 +543,15 @@ switch ($sortField) {
switch ($sort) { switch ($sort) {
case 'up': case 'up':
$selectIntervalUp = $selected; $selectIntervalUp = $selected;
$order = array('field' => 'tagente_modulo.module_interval', 'order' => 'ASC'); $order = array(
'field' => 'tagente_modulo.module_interval',
'order' => 'ASC');
break; break;
case 'down': case 'down':
$selectIntervalDown = $selected; $selectIntervalDown = $selected;
$order = array('field' => 'tagente_modulo.module_interval', 'order' => 'DESC'); $order = array(
'field' => 'tagente_modulo.module_interval',
'order' => 'DESC');
break; break;
} }
break; break;
@ -545,11 +559,15 @@ switch ($sortField) {
switch ($sort) { switch ($sort) {
case 'up': case 'up':
$selectStatusUp = $selected; $selectStatusUp = $selected;
$order = array('field' => 'tagente_estado.estado', 'order' => 'ASC'); $order = array(
'field' => 'tagente_estado.estado',
'order' => 'ASC');
break; break;
case 'down': case 'down':
$selectStatusDown = $selected; $selectStatusDown = $selected;
$order = array('field' => 'tagente_estado.estado', 'order' => 'DESC'); $order = array(
'field' => 'tagente_estado.estado',
'order' => 'DESC');
break; break;
} }
break; break;
@ -557,11 +575,15 @@ switch ($sortField) {
switch ($sort) { switch ($sort) {
case 'up': case 'up':
$selectDataUp = $selected; $selectDataUp = $selected;
$order = array('field' => 'tagente_estado.datos', 'order' => 'ASC'); $order = array(
'field' => 'tagente_estado.datos',
'order' => 'ASC');
break; break;
case 'down': case 'down':
$selectDataDown = $selected; $selectDataDown = $selected;
$order = array('field' => 'tagente_estado.datos', 'order' => 'DESC'); $order = array(
'field' => 'tagente_estado.datos',
'order' => 'DESC');
break; break;
} }
break; break;
@ -569,11 +591,15 @@ switch ($sortField) {
switch ($sort) { switch ($sort) {
case 'up': case 'up':
$selectTimestampUp = $selected; $selectTimestampUp = $selected;
$order = array('field' => 'tagente_estado.utimestamp', 'order' => 'ASC'); $order = array(
'field' => 'tagente_estado.utimestamp',
'order' => 'ASC');
break; break;
case 'down': case 'down':
$selectTimestampDown = $selected; $selectTimestampDown = $selected;
$order = array('field' => 'tagente_estado.utimestamp', 'order' => 'DESC'); $order = array(
'field' => 'tagente_estado.utimestamp',
'order' => 'DESC');
break; break;
} }
break; break;
@ -592,7 +618,8 @@ switch ($sortField) {
$selectDataDown = ''; $selectDataDown = '';
$selectTimestampUp = ''; $selectTimestampUp = '';
$selectTimestampDown = ''; $selectTimestampDown = '';
$order = array('field' => 'tagente.nombre', $order = array(
'field' => 'tagente.nombre',
'order' => 'ASC'); 'order' => 'ASC');
break; break;
} }
@ -966,14 +993,20 @@ foreach ($result as $row) {
$data[3] .= ui_print_help_tip ($row["extended_info"], true, '/images/comments.png'); $data[3] .= ui_print_help_tip ($row["extended_info"], true, '/images/comments.png');
} }
if ($row["tags"] != "") { 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, '[&hellip;]', 'font-size:7pt;'); $data[4] = ui_print_truncate_text($row['tags'], 'agent_small', false, true, true, '[&hellip;]', '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 || if ($row['utimestamp'] == 0 && (($row['module_type'] < 21 ||
$row['module_type'] > 23) && $row['module_type'] != 100)) { $row['module_type'] > 23) && $row['module_type'] != 100)) {
@ -1060,46 +1093,67 @@ foreach ($result as $row) {
$module_value = io_safe_output($row["datos"]); $module_value = io_safe_output($row["datos"]);
} }
$sub_string = substr(io_safe_output($row["datos"]), 0, 12); $is_snapshot = is_snapshot_data ( $module_value );
if ($module_value == $sub_string) {
$salida = $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 = '<a href="javascript:' . $link . '">' .
html_print_image("images/default_list.png", true,
array("border" => '0',
"alt" => "",
"title" => __("Snapshot view"))) . '</a> &nbsp;&nbsp;';
} }
else { 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) { if ($module_value == $sub_string) {
$salida = $module_value; $salida = $module_value;
} }
else { else {
$salida = "<span " . //Fixed the goliat sends the strings from web
"id='hidden_value_module_" . $row["id_agente_modulo"] . "' //without HTML entities
style='display: none;'>" . if ($is_web_content_string) {
$module_value . $sub_string = substr($row["datos"], 0, 12);
"</span>" . }
"<span " . else {
"id='value_module_" . $row["id_agente_modulo"] . "' //Fixed the data from Selenium Plugin
title='" . $module_value . "' " . if ($module_value != strip_tags($module_value)) {
"style='white-space: nowrap;'>" . $module_value = io_safe_input($module_value);
'<span id="value_module_text_' . $row["id_agente_modulo"] . '">' . $sub_string = substr($row["datos"], 0, 12);
$sub_string . '</span> ' . }
"<a href='javascript: toggle_full_value(" . $row["id_agente_modulo"] . ")'>" . else {
html_print_image("images/rosette.png", true) . "</a>" . "</span>"; $sub_string = substr(io_safe_output($row["datos"]),0, 12);
}
}
if ($module_value == $sub_string) {
$salida = $module_value;
}
else {
$salida = "<span " .
"id='hidden_value_module_" . $row["id_agente_modulo"] . "'
style='display: none;'>" .
$module_value .
"</span>" .
"<span " .
"id='value_module_" . $row["id_agente_modulo"] . "'
title='" . $module_value . "' " .
"style='white-space: nowrap;'>" .
'<span id="value_module_text_' . $row["id_agente_modulo"] . '">' .
$sub_string . '</span> ' .
"<a href='javascript: toggle_full_value(" . $row["id_agente_modulo"] . ")'>" .
html_print_image("images/rosette.png", true) . "</a>" . "</span>";
}
} }
} }
} }