diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 8785a1af3b..631e3a964c 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,14 @@ +2013-02-05 Miguel de Dios + + * operation/agentes/estado_monitores.php, + operation/agentes/datos_agente.php, godmode/setup/setup.php, + include/functions_config.php: added the can disabled the command + snapshot. + + Fixes: #3602773 + + MERGED FROM PANDORA_4 + 2013-02-05 Sergio Martin * operation/events/events_list.php diff --git a/pandora_console/godmode/setup/setup_general.php b/pandora_console/godmode/setup/setup_general.php index 78e68db268..64cac84709 100644 --- a/pandora_console/godmode/setup/setup_general.php +++ b/pandora_console/godmode/setup/setup_general.php @@ -233,6 +233,12 @@ $table->data[30][1] = __('Yes') . '   ' . $table->data[30][1] .= __('No') . '   ' . html_print_radio_button ('event_storm_protection', 0, '', $config["event_storm_protection"], true); + +$table->data[31][0] = __('Command Snapshot') . + ui_print_help_tip(__('The string modules with several lines show as command output'), true); +$table->data[31][1] = __('Yes').'   '.html_print_radio_button ('command_snapshot', 1, '', $config["command_snapshot"], true).'  '; +$table->data[31][1] .= __('No').'   '.html_print_radio_button ('command_snapshot', 0, '', $config["command_snapshot"], true); + echo '
'; echo "
"; diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 7ae47bf55d..75db5fc4c4 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -130,6 +130,7 @@ function config_update_config () { config_update_value ('public_url', get_parameter('public_url')); config_update_value ('referer_security', get_parameter('referer_security')); config_update_value ('event_storm_protection', get_parameter('event_storm_protection')); + config_update_value ('command_snapshot', get_parameter('command_snapshot')); break; case 'enterprise': if (isset($config['enterprise_installed']) && $config['enterprise_installed'] == 1) { @@ -868,6 +869,9 @@ function config_process_config () { if (!isset($config['event_storm_protection'])) { config_update_value ('event_storm_protection', 0); } + + if (!isset($config['command_snapshot'])) { + config_update_value ('command_snapshot', 1); /* Finally, check if any value was overwritten in a form */ config_update_config(); diff --git a/pandora_console/operation/agentes/datos_agente.php b/pandora_console/operation/agentes/datos_agente.php index b24468dea9..a22965d0ae 100644 --- a/pandora_console/operation/agentes/datos_agente.php +++ b/pandora_console/operation/agentes/datos_agente.php @@ -237,7 +237,7 @@ foreach ($result as $row) { $data[] = $attr[1] ($row[$attr[0]]); // Its a single-data, multiline data (data snapshot) ? - elseif (preg_match ("/[\n]+/i", $row[$attr[0]])){ + elseif (($config['command_snapshot']) && (preg_match ("/[\n]+/i", $row[$attr[0]]))) { // Detect string data with \n and convert to
's $datos = preg_replace ('/\n/i','
',$row[$attr[0]]); diff --git a/pandora_console/operation/agentes/estado_monitores.php b/pandora_console/operation/agentes/estado_monitores.php index 2da8829ac0..536dba51d4 100644 --- a/pandora_console/operation/agentes/estado_monitores.php +++ b/pandora_console/operation/agentes/estado_monitores.php @@ -28,10 +28,10 @@ if (is_ajax ()) { if ($tags === false) $tags = array(); - + echo '

Tag\'s information

'; foreach ($tags as $tag) { - echo tags_get_name($tag).'
'; + echo tags_get_name($tag).'
'; } return; @@ -443,7 +443,7 @@ foreach ($modules as $module) { // There are carriage returns here ? // If carriage returns present... then is a "Snapshot" data (full command output) - if (preg_match ("/[\n]+/i", io_safe_output($module["datos"]))){ + if (($config['command_snapshot']) && (preg_match ("/[\n]+/i", io_safe_output($module["datos"])))) { $handle = "snapshot"."_".$module["id_agente_modulo"]; $url = 'include/procesos.php?agente='.$module["id_agente_modulo"];