diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 0edb58f783..e75b60f3d1 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -239,7 +239,7 @@ switch ($action) { case 'SLA_weekly': case 'SLA_monthly': case 'SLA_hourly': - case 'availability_graph'; + case 'availability_graph': $description = $item['description']; $only_display_wrong = $item['only_display_wrong']; $monday = $item['monday']; @@ -257,6 +257,13 @@ switch ($action) { $period = $item['period']; break; + case 'module_histogram_graph': + $description = $item['description']; + $period = $item['period']; + $idAgentModule = $item['id_agent_module']; + $idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $idAgentModule)); + break; + case 'SLA_services': $description = $item['description']; $period = $item['period']; @@ -1988,7 +1995,6 @@ $(document).ready (function () { }); - $("#submit-create_item").click(function () { var type = $('#type').val(); switch (type){ @@ -1998,7 +2004,7 @@ $(document).ready (function () { case 'MTBF': case 'MTTR': case 'prediction_date': case 'projection_graph': case 'avg_value': case 'max_value': case 'min_value': case 'monitor_report': case 'database_serialized': case 'sumatory': case 'historical_data': - case 'agent_configuration': + case 'agent_configuration': case 'module_histogram_graph': if ($("#hidden-id_agent").val() == 0) { alert( ); return false; @@ -2018,7 +2024,7 @@ $(document).ready (function () { case 'MTBF': case 'MTTR': case 'prediction_date': case 'projection_graph': case 'avg_value': case 'max_value': case 'min_value': case 'monitor_report': case 'database_serialized': case 'sumatory': case 'historical_data': - case 'agent_configuration': + case 'agent_configuration': case 'module_histogram_graph': if ($("#hidden-id_agent").val() == 0) { alert( ); return false; diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index b2ed138f01..97e3d0858e 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -1162,6 +1162,7 @@ switch ($action) { else $style['label'] = ''; break; + case 'module_histogram_graph': case 'agent_configuration': case 'alert_report_agent': case 'alert_report_module': @@ -1489,6 +1490,7 @@ switch ($action) { else $style['label'] = ''; break; + case 'module_histogram_graph': case 'agent_configuration': case 'alert_report_agent': case 'alert_report_module': diff --git a/pandora_console/images/square_yellow.png b/pandora_console/images/square_yellow.png new file mode 100644 index 0000000000..9d5d2b85ac Binary files /dev/null and b/pandora_console/images/square_yellow.png differ diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index a2deb37203..bb0d9fdd4e 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -500,6 +500,12 @@ function reporting_make_reporting_data($report = null, $id_report, $force_width_chart, $force_height_chart); break; + case 'module_histogram_graph': + $report['contents'][] = reporting_enterprise_module_histogram_graph( + $report, + $content, + $pdf); + break; } } @@ -6799,27 +6805,29 @@ function reporting_get_group_stats_resume ($id_group = 0, $access = 'AR') { GROUP BY tae.id_agente;"; $data_array_2 = db_get_all_rows_sql($sql); - foreach ($data_array_2 as $key => $value) { - if($value['monitor_agent_critical'] != 0){ - $data['agent_critical'] ++; + if (is_array($data_array_2) || is_object($data_array_2)){ + foreach ($data_array_2 as $key => $value) { + if($value['monitor_agent_critical'] != 0){ + $data['agent_critical'] ++; + } + elseif($value['monitor_agent_critical'] == 0 && $value['monitor_agent_warning'] != 0){ + $data['agent_warning'] ++; + } + elseif($value['monitor_agent_critical'] == 0 && $value['monitor_agent_warning'] == 0 && + $value['monitor_agent_unknown'] != 0){ + $data['agent_unknown'] ++; + } + elseif($value['monitor_agent_critical'] == 0 && $value['monitor_agent_warning'] == 0 && + $value['monitor_agent_unknown'] == 0 && $value['monitor_agent_ok'] != 0){ + $data['agent_ok'] ++; + } + elseif($value['monitor_agent_critical'] == 0 && $value['monitor_agent_warning'] == 0 && + $value['monitor_agent_unknown'] == 0 && $value['monitor_agent_ok'] == 0 && + $value['monitor_agent_not_init'] != 0){ + $data['agent_not_init'] ++; + } + $data['total_agents'] ++; } - elseif($value['monitor_agent_critical'] == 0 && $value['monitor_agent_warning'] != 0){ - $data['agent_warning'] ++; - } - elseif($value['monitor_agent_critical'] == 0 && $value['monitor_agent_warning'] == 0 && - $value['monitor_agent_unknown'] != 0){ - $data['agent_unknown'] ++; - } - elseif($value['monitor_agent_critical'] == 0 && $value['monitor_agent_warning'] == 0 && - $value['monitor_agent_unknown'] == 0 && $value['monitor_agent_ok'] != 0){ - $data['agent_ok'] ++; - } - elseif($value['monitor_agent_critical'] == 0 && $value['monitor_agent_warning'] == 0 && - $value['monitor_agent_unknown'] == 0 && $value['monitor_agent_ok'] == 0 && - $value['monitor_agent_not_init'] != 0){ - $data['agent_not_init'] ++; - } - $data['total_agents'] ++; } // Get total count of monitors for this group, except disabled. @@ -10324,6 +10332,7 @@ function reporting_label_macro ($item, $label) { } break; case 'simple_graph': + case 'module_histogram_graph': case 'custom_graph': case 'simple_baseline_graph': case 'event_report_module': diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 4f42722304..723065d57d 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -318,6 +318,9 @@ function reporting_html_print_report($report, $mini = false, $report_info = 1) { case 'SLA_services': reporting_enterprise_html_SLA_services($table, $item, $mini); break; + case 'module_histogram_graph': + reporting_enterprise_html_module_histogram_graph($table, $item, $mini); + break; } if ($item['type'] == 'agent_module') diff --git a/pandora_console/include/functions_reports.php b/pandora_console/include/functions_reports.php index ce90436d54..42ce40a76e 100755 --- a/pandora_console/include/functions_reports.php +++ b/pandora_console/include/functions_reports.php @@ -522,7 +522,8 @@ function reports_get_report_types ($template = false, $not_editor = false) { $types['availability_graph'] = array('optgroup' => __('Graphs'), 'name' => __('Availability graph')); - + $types['module_histogram_graph'] = array('optgroup' => __('Graphs'), + 'name' => __('Module Histogram graph')); $types['TTRT'] = array('optgroup' => __('ITIL'), 'name' => __('TTRT'));