diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index d367dd6a33..113bac230b 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -602,7 +602,14 @@ switch ($action) { $data[1] = $report['description']; - if (!$report['non_interactive']) { + //Remove html and xml button if items are larger than limit + $item_count = db_get_num_rows ('SELECT * FROM treport_content WHERE id_report=' . $report['id_report']); + $report['overload'] = $item_count >= $config['report_limit']; + if ($report['overload']) { + $data[2] = html_print_image("images/application_not_writable.png", true, array('title' => __('This report exceeds the item limit for realtime operations'))); + $data[3] = null; + } + else if (!$report['non_interactive']) { $data[2] = '' . html_print_image("images/html.png", true, array('title' => __('HTML view'))) . ''; $data[3] = '' . html_print_image("images/xml.png", true, array('title' => __('Export to XML'))) . ''; //I chose ajax.php because it's supposed to give XML anyway diff --git a/pandora_console/godmode/setup/performance.php b/pandora_console/godmode/setup/performance.php index 654318d7b4..2158bcddeb 100644 --- a/pandora_console/godmode/setup/performance.php +++ b/pandora_console/godmode/setup/performance.php @@ -77,8 +77,12 @@ $table_other->style[0] = "font-weight: bold"; $table_other->size[0] = '70%'; $table_other->size[1] = '30%'; -$table_other->data[1][0] = __('Compact interpolation in hours (1 Fine-20 bad)') . ui_print_help_tip(__('Data will be compacted in intervals of the specified length.'), true); -$table_other->data[1][1] = html_print_input_text ('step_compact', +$table_other->data[1][0] = __('Item limit for realtime reports') . ui_print_help_tip(__('Set a value too high cause a slowdown on console and a performance penalty in the system.'), true); +$table_other->data[1][1] = html_print_input_text ('report_limit', + $config["report_limit"], '', 5, 5, true); + +$table_other->data[2][0] = __('Compact interpolation in hours (1 Fine-20 bad)') . ui_print_help_tip(__('Data will be compacted in intervals of the specified length.'), true); +$table_other->data[2][1] = html_print_input_text ('step_compact', $config["step_compact"], '', 5, 5, true); $intervals = array (); diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 0b0e419d4e..ce619227e1 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -376,6 +376,8 @@ function config_update_config () { $error_update[] = __('Max. days before delete unknown modules'); if (!config_update_value ('days_compact', (int) get_parameter ('days_compact'))) $error_update[] = __('Max. days before compact data'); + if (!config_update_value ('report_limit', (int) get_parameter ('report_limit'))) + $error_update[] = __('Item limit for realtime reports)'); if (!config_update_value ('step_compact', (int) get_parameter ('step_compact'))) $error_update[] = __('Compact interpolation in hours (1 Fine-20 bad)'); if (!config_update_value ('event_view_hr', (int) get_parameter ('event_view_hr'))) @@ -708,6 +710,10 @@ function config_process_config () { config_update_value ('event_view_hr', 8); } + if (!isset ($config['report_limit'])) { + config_update_value ('report_limit', 100); + } + if (!isset ($config['loginhash_pwd'])) { config_update_value ('loginhash_pwd', io_input_password(rand (0, 1000) * rand (0, 1000)."pandorahash")); }