diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index f6e79f5f46..2203bb2b3e 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,13 @@ +2011-12-12 Sergio Martin + + * include/functions_graph.php: Fixed some notices of the graphs + when no data + + * include/functions_reporting.php + include/functions.php + godmode/reporting/reporting_builder.item_editor.php: Added the + first version of the new group report 3438332 + 2011-12-09 Junichi Satoh * include/help/ja/help_custom_logo.php: Changed height and width in diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 3987be2e68..758d9921b9 100644 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -291,6 +291,9 @@ switch ($action) { $show_resume = $item['show_resume']; $show_graph = $item['show_graph']; break; + case 'group_report': + $group = $item['id_group']; + break; case 'top_n': $description = $item['description']; $period = $item['period']; @@ -1321,6 +1324,9 @@ function chooseType() { $("#row_show_resume").css('display', ''); $("#row_show_in_two_columns").css('display', ''); break; + case 'group_report': + $("#row_group").css('display', ''); + break; case 'top_n': $("#row_description").css('display', ''); $("#row_period").css('display', ''); diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 0e41db28f2..de68920fc2 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -733,6 +733,7 @@ function get_report_types () { $types['event_report_module'] = __('Event report module'); $types['event_report_group'] = __('Event report group'); $types['general'] = __('General'); + $types['group_report'] = __('Group report'); $types['top_n'] = __('Top n'); $types['exception'] = __('Exception'); if ($config['metaconsole'] != 1) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 771f575936..1be3ad197c 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -480,6 +480,9 @@ function graphic_combined_module ($module_list, $weight_list, $period, $width, $ $time_format = 'M j'; } + $graph_values = array(); + $module_name_list = array(); + // Calculate data for each module for ($i = 0; $i < $module_number; $i++) { // If its a projection graph, first module will be data and second will be the projection diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index b6163f3d25..879ee3f83e 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -3022,6 +3022,54 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f $table->colspan[2][0] = 3; $data[0] = '

'.$mttr.'

'; array_push ($table->data, $data); + break; + case 'group_report': + $group_name = groups_get_name($content['id_group']); + $group_stats = reporting_get_group_stats($content['id_group']); + + $data = array (); + + $table->colspan[0][0] = 7; + $table->colspan[1][3] = 4; + $table->colspan[3][3] = 4; + $table->colspan[4][2] = 5; + $data[0] = $sizh. __('Group report').': "'.$group_name.'"' . $sizhfin; + + array_push ($table->data, $data); + + $data = array(); + $data[0] = ''.__('Agents').''; + $data[1] = __('Total').' ('.$group_stats['total_agents'].')'; + $data[2] = __('Unknown').' ('.$group_stats['agents_unknown'].')'; + $data[3] = ''; + array_push ($table->data, $data); + + $data = array(); + $data[0] = ''.__('Monitors').''; + $data[1] = __('Total').' ('.$group_stats['monitor_checks'].')'; + $data[2] = __('Normal').' ('.$group_stats['monitor_ok'].')'; + $data[3] = __('Critical').' ('.$group_stats['monitor_critical'].')'; + $data[4] = __('Warning').' ('.$group_stats['monitor_warning'].')'; + $data[5] = __('Unknown').' ('.$group_stats['monitor_unknown'].')'; + $data[6] = __('Not init').' ('.$group_stats['monitor_not_init'].')'; + array_push ($table->data, $data); + + $data = array(); + $data[0] = ''.__('Alerts').''; + $data[1] = __('Total').' ('.$group_stats['monitor_alerts'].')'; + $data[2] = __('Fired').' ('.$group_stats['monitor_alerts_fired'].')'; + $data[3] = ''; + array_push ($table->data, $data); + + // Get events of the last 8 hours + $events = events_get_group_events ($content['id_group'], 28800, $report["datetime"]); + + $data = array(); + $data[0] = ''.__('Events').''; + $data[1] = __('Last 8 hours events').' ('.count($events).')'; + $data[2] = ''; + array_push ($table->data, $data); + break; case 'general': $group_by_agent = $content['group_by_agent'];