2012-03-22 Miguel de Dios <miguel.dedios@artica.es>
& Sergio Martin <sergio.martin@artica.es> using Gobby collaborative real-time editor http://obby.0x539.de * include/functions.php: changed into the function "get_report_types" the array types to tree for show better the select box, and changed into the function "get_report_name". * include/functions_forecast.php: fixed into the function "forecast_projection_graph" when zero data and change to user the user conf style for the dates. * include/functions_html.php: the function "html_debug_print" was improved to show type and sizes. * include/functions_reporting.php: renamed the function "header_content" to "reporting_header_content" and in this function change to use the user conf style for the dates. * include/functions_networkmap.php: cleaned source code style. Merged from the branch pandora_4.0 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5816 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
6b85f707dc
commit
d21b47222d
|
@ -1,3 +1,27 @@
|
|||
2012-03-22 Miguel de Dios <miguel.dedios@artica.es>
|
||||
& Sergio Martin <sergio.martin@artica.es> using Gobby collaborative
|
||||
real-time editor http://obby.0x539.de
|
||||
|
||||
* include/functions.php: changed into the function "get_report_types" the
|
||||
array types to tree for show better the select box, and changed into the
|
||||
function "get_report_name".
|
||||
|
||||
* include/functions_forecast.php: fixed into the function
|
||||
"forecast_projection_graph" when zero data and change to user the user conf
|
||||
style for the dates.
|
||||
|
||||
* include/functions_html.php: the function "html_debug_print" was improved
|
||||
to show type and sizes.
|
||||
|
||||
* include/functions_reporting.php: renamed the function "header_content" to
|
||||
"reporting_header_content" and in this function change to use the user conf
|
||||
style for the dates.
|
||||
|
||||
* include/functions_networkmap.php: cleaned source code style.
|
||||
|
||||
Merged from the branch pandora_4.0
|
||||
|
||||
|
||||
2012-03-22 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* godmode/reporting/graph_builder.php: Reallocate
|
||||
|
|
|
@ -528,9 +528,10 @@ function human_time_description_raw ($seconds, $exactly = false, $units = 'large
|
|||
* @return int The current time minus the seconds given.
|
||||
*/
|
||||
function human_date_relative ($seconds) {
|
||||
$ahora=date("Y/m/d H:i:s");
|
||||
$ahora = date("Y/m/d H:i:s");
|
||||
$ahora_s = date("U");
|
||||
$ayer = date ("Y/m/d H:i:s", $ahora_s - $seconds);
|
||||
|
||||
return $ayer;
|
||||
}
|
||||
|
||||
|
@ -549,6 +550,7 @@ function render_time ($lapse) {
|
|||
$output .= "00";
|
||||
else
|
||||
$output .= $mymin;
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
@ -569,7 +571,7 @@ function get_parameterBetweenListValues ($name, $values, $default) {
|
|||
// POST has precedence
|
||||
if (isset($_POST[$name]))
|
||||
$parameter = get_parameter_post ($name, $default);
|
||||
|
||||
|
||||
if (isset($_GET[$name]))
|
||||
$parameter = get_parameter_get ($name, $default);
|
||||
|
||||
|
@ -737,58 +739,105 @@ function get_report_types () {
|
|||
global $config;
|
||||
|
||||
$types = array ();
|
||||
$types['simple_graph'] = __('Simple graph');
|
||||
if($config['enterprise_installed']) {
|
||||
$types['simple_baseline_graph'] = __('Simple baseline graph');
|
||||
}
|
||||
$types['custom_graph'] = __('Custom graph');
|
||||
$types['SLA'] = __('S.L.A.');
|
||||
$types['monitor_report'] = __('Monitor report');
|
||||
$types['avg_value'] = __('Avg. Value');
|
||||
$types['max_value'] = __('Max. Value');
|
||||
$types['min_value'] = __('Min. Value');
|
||||
$types['sumatory'] = __('Summatory');
|
||||
//$types['agent_detailed'] = __('Agent detailed view');
|
||||
$types['text'] = __ ('Text');
|
||||
|
||||
$types['simple_graph'] = array('optgroup' => __('Graphs'),
|
||||
'name' => __('Simple graph'));
|
||||
if($config['enterprise_installed']) {
|
||||
$types['simple_baseline_graph'] = array('optgroup' => __('Graphs'),
|
||||
'name' => __('Simple baseline graph'));
|
||||
}
|
||||
$types['custom_graph'] = array('optgroup' => __('Graphs'),
|
||||
'name' => __('Custom graph'));
|
||||
# Only pandora managers have access to the whole database
|
||||
if (check_acl ($config['id_user'], 0, "PM")) {
|
||||
$types['sql'] = __('SQL query');
|
||||
$types['sql_graph_vbar'] = __('SQL vertical bar graph');
|
||||
$types['sql_graph_pie'] = __('SQL pie graph');
|
||||
$types['sql_graph_hbar'] = __('SQL horizonal bar graph');
|
||||
$types['sql_graph_vbar'] = array('optgroup' => __('Graphs'),
|
||||
'name' => __('SQL vertical bar graph'));
|
||||
$types['sql_graph_pie'] = array('optgroup' => __('Graphs'),
|
||||
'name' => __('SQL pie graph'));
|
||||
$types['sql_graph_hbar'] = array('optgroup' => __('Graphs'),
|
||||
'name' => __('SQL horizonal bar graph'));
|
||||
}
|
||||
|
||||
$types['url'] = __('Import text from URL');
|
||||
$types['database_serialized'] = __('Serialize data');
|
||||
$types['TTRT'] = __('TTRT');
|
||||
$types['TTO'] = __('TTO');
|
||||
$types['MTBF'] = __('MTBF');
|
||||
$types['MTTR'] = __('MTTR');
|
||||
$types['alert_report_module'] = __('Alert report module');
|
||||
$types['alert_report_agent'] = __('Alert report agent');
|
||||
$types['event_report_agent'] = __('Event report agent');
|
||||
$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');
|
||||
|
||||
|
||||
|
||||
$types['TTRT'] = array('optgroup' => __('ITIL'),
|
||||
'name' => __('TTRT'));
|
||||
$types['TTO'] = array('optgroup' => __('ITIL'),
|
||||
'name' => __('TTO'));
|
||||
$types['MTBF'] = array('optgroup' => __('ITIL'),
|
||||
'name' => __('MTBF'));
|
||||
$types['MTTR'] = array('optgroup' => __('ITIL'),
|
||||
'name' => __('MTTR'));
|
||||
|
||||
|
||||
|
||||
$types['SLA'] = array('optgroup' => __('SLA'),
|
||||
'name' => __('S.L.A.'));
|
||||
|
||||
|
||||
|
||||
$types['prediction_date'] = array('optgroup' => __('Forecating'),
|
||||
'name' => __('Prediction date'));
|
||||
$types['projection_graph'] = array('optgroup' => __('Forecating'),
|
||||
'name' => __('Projection graph'));
|
||||
|
||||
|
||||
|
||||
$types['avg_value'] = array('optgroup' => __('Modules'),
|
||||
'name' => __('Avg. Value'));
|
||||
$types['max_value'] = array('optgroup' => __('Modules'),
|
||||
'name' => __('Max. Value'));
|
||||
$types['min_value'] = array('optgroup' => __('Modules'),
|
||||
'name' => __('Min. Value'));
|
||||
$types['monitor_report'] = array('optgroup' => __('Modules'),
|
||||
'name' => __('Monitor report'));
|
||||
$types['database_serialized'] = array('optgroup' => __('Modules'),
|
||||
'name' => __('Serialize data'));
|
||||
$types['sumatory'] = array('optgroup' => __('Modules'),
|
||||
'name' => __('Summatory'));
|
||||
|
||||
|
||||
|
||||
$types['general'] = array('optgroup' => __('Grouped'),
|
||||
'name' => __('General'));
|
||||
$types['group_report'] = array('optgroup' => __('Grouped'),
|
||||
'name' => __('Group report'));
|
||||
$types['exception'] = array('optgroup' => __('Grouped'),
|
||||
'name' => __('Exception'));
|
||||
if ($config['metaconsole'] != 1)
|
||||
$types['agent_module'] = __('Agents/Modules');
|
||||
$types['projection_graph'] = __('Projection graph');
|
||||
$types['prediction_date'] = __('Prediction date');
|
||||
// $types['agent_detailed_event'] = __('Agent detailed event');
|
||||
// $types['list_events_module'] = __('List events of module');
|
||||
// $types['list_events_agent'] = __('List events of agent');
|
||||
// $types['list_alerts_agent'] = __('List alerts of agent');
|
||||
// $types['list_alerts_module'] = __('List alerts of module');
|
||||
// $types['agent_detailed_event_pie_char'] = __('Agent detailed pie chart events');
|
||||
// $types['agent_detailed_event_last_hours'] = __('Agent detailed event in last hours');
|
||||
// $types['agent_detailed_alert_last_hours'] = __('Agent detailed alerts in last hours');
|
||||
// $types['agent_detailed_num_modules'] = __('Agent detailed num modules');
|
||||
// $types['agent_detailed_num_alerts'] = __('Agent detailed num alerts');
|
||||
|
||||
$types['agent_module'] = array('optgroup' => __('Grouped'),
|
||||
'name' => __('Agents/Modules'));
|
||||
# Only pandora managers have access to the whole database
|
||||
if (check_acl ($config['id_user'], 0, "PM")) {
|
||||
$types['sql'] = array('optgroup' => __('Grouped'),
|
||||
'name' => __('SQL query'));
|
||||
}
|
||||
$types['top_n'] = array('optgroup' => __('Grouped'),
|
||||
'name' => __('Top n'));
|
||||
|
||||
|
||||
|
||||
$types['text'] = array('optgroup' => __('Text/HTML '),
|
||||
'name' => __ ('Text'));
|
||||
$types['url'] = array('optgroup' => __('Text/HTML '),
|
||||
'name' => __('Import text from URL'));
|
||||
|
||||
|
||||
|
||||
$types['alert_report_module'] = array('optgroup' => __('Alerts'),
|
||||
'name' => __('Alert report module'));
|
||||
$types['alert_report_agent'] = array('optgroup' => __('Alerts'),
|
||||
'name' => __('Alert report agent'));
|
||||
|
||||
|
||||
|
||||
$types['event_report_agent'] = array('optgroup' => __('Events'),
|
||||
'name' => __('Event report agent'));
|
||||
$types['event_report_module'] = array('optgroup' => __('Events'),
|
||||
'name' => __('Event report module'));
|
||||
$types['event_report_group'] = array('optgroup' => __('Events'),
|
||||
'name' => __('Event report group'));
|
||||
|
||||
return $types;
|
||||
}
|
||||
|
||||
|
@ -803,7 +852,8 @@ function get_report_name ($type) {
|
|||
$types = get_report_types ();
|
||||
if (! isset ($types[$type]))
|
||||
return __('Unknown');
|
||||
return $types[$type];
|
||||
|
||||
return $types[$type]['name'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -817,37 +867,41 @@ function get_report_name ($type) {
|
|||
*/
|
||||
function get_report_type_data_source ($type) {
|
||||
switch ($type) {
|
||||
case 1:
|
||||
case 'simple_graph':
|
||||
case 6:
|
||||
case 'monitor_report':
|
||||
case 7:
|
||||
case 'avg_value':
|
||||
case 8:
|
||||
case 'max_value':
|
||||
case 9:
|
||||
case 'min_value':
|
||||
case 10:
|
||||
case 'sumatory':
|
||||
case 'agent_detailed_event':
|
||||
return 'module';
|
||||
case 2:
|
||||
case 'custom_graph':
|
||||
return 'custom-graph';
|
||||
case 3:
|
||||
case 'SLA':
|
||||
case 4:
|
||||
case 'event_report':
|
||||
case 5:
|
||||
case 'alert_report':
|
||||
case 11:
|
||||
case 'general_group_report':
|
||||
case 12:
|
||||
case 'monitor_health':
|
||||
case 13:
|
||||
case 'agents_detailed':
|
||||
return 'agent-group';
|
||||
case 1:
|
||||
case 'simple_graph':
|
||||
case 6:
|
||||
case 'monitor_report':
|
||||
case 7:
|
||||
case 'avg_value':
|
||||
case 8:
|
||||
case 'max_value':
|
||||
case 9:
|
||||
case 'min_value':
|
||||
case 10:
|
||||
case 'sumatory':
|
||||
case 'agent_detailed_event':
|
||||
return 'module';
|
||||
break;
|
||||
case 2:
|
||||
case 'custom_graph':
|
||||
return 'custom-graph';
|
||||
break;
|
||||
case 3:
|
||||
case 'SLA':
|
||||
case 4:
|
||||
case 'event_report':
|
||||
case 5:
|
||||
case 'alert_report':
|
||||
case 11:
|
||||
case 'general_group_report':
|
||||
case 12:
|
||||
case 'monitor_health':
|
||||
case 13:
|
||||
case 'agents_detailed':
|
||||
return 'agent-group';
|
||||
break;
|
||||
}
|
||||
|
||||
return 'unknown';
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ function forecast_projection_graph($module_id, $period = 5184000, $prediction_pe
|
|||
|
||||
$data[0] = '';
|
||||
$data[1] = $cont;
|
||||
$data[2] = date('d M Y H:i:s', $utimestamp);
|
||||
$data[2] = date($config["date_format"], $utimestamp);
|
||||
$data[3] = $utimestamp;
|
||||
$data[4] = $row['sum'];
|
||||
$data[5] = $utimestamp * $row['sum'];
|
||||
|
@ -141,6 +141,7 @@ function forecast_projection_graph($module_id, $period = 5184000, $prediction_pe
|
|||
|
||||
$b_num = (($cont * $sum_xi_yi) - ($sum_xi * $sum_yi));
|
||||
$b_den = (($cont * $sum_xi2) - ($sum_xi * $sum_xi));
|
||||
if ($b_den == 0) return;
|
||||
$b = $b_num / $b_den;
|
||||
|
||||
$a_num = ($sum_yi) - ($b * $sum_xi);
|
||||
|
|
|
@ -45,7 +45,21 @@ function html_debug_print ($var, $file = '') {
|
|||
if (strlen($file) > 0) {
|
||||
$f = fopen($file, "a");
|
||||
ob_start();
|
||||
echo date("Y/m/d H:i:s") . "\n";
|
||||
$more_info = '';
|
||||
if (is_string($var)) {
|
||||
$more_info = 'size: ' . strlen($var);
|
||||
}
|
||||
elseif (is_bool($var)) {
|
||||
$more_info = 'val: ' .
|
||||
($var ? 'true' : 'false');
|
||||
}
|
||||
elseif (is_null($var)) {
|
||||
$more_info = 'is null';
|
||||
}
|
||||
elseif (is_array($var)) {
|
||||
$more_info = count($var);
|
||||
}
|
||||
echo date("Y/m/d H:i:s") . " (" . gettype($var) . ") " . $more_info . "\n";
|
||||
print_r($var);
|
||||
echo "\n\n";
|
||||
$output = ob_get_clean();
|
||||
|
@ -463,7 +477,7 @@ function html_print_extended_select_for_time ($name, $selected = '', $script = '
|
|||
";
|
||||
|
||||
$returnString = ob_get_clean();
|
||||
|
||||
|
||||
if ($return)
|
||||
return $returnString;
|
||||
else
|
||||
|
|
|
@ -708,8 +708,9 @@ function networkmap_get_networkmaps ($id_user = '', $type = '', $optgrouped = tr
|
|||
$networkmaps = array();
|
||||
foreach($networkmaps_raw as $key => $networkmapitem) {
|
||||
if($optgrouped) {
|
||||
$networkmaps[$networkmapitem['id_networkmap']] = array('name' => $networkmapitem['name'],
|
||||
'optgroup' => $networkmapitem['type']);
|
||||
$networkmaps[$networkmapitem['id_networkmap']] =
|
||||
array('name' => $networkmapitem['name'],
|
||||
'optgroup' => $networkmapitem['type']);
|
||||
}
|
||||
else {
|
||||
$networkmaps[$networkmapitem['id_networkmap']] = $networkmapitem['name'];
|
||||
|
|
|
@ -2128,7 +2128,9 @@ function sla_value_asc_cmp($a, $b)
|
|||
/**
|
||||
* Make the header for each content.
|
||||
*/
|
||||
function header_content($mini, $content, $report, &$table, $title = false, $name = false, $period = false) {
|
||||
function reporting_header_content($mini, $content, $report, &$table, $title = false, $name = false, $period = false) {
|
||||
global $config;
|
||||
|
||||
if ($mini) {
|
||||
$sizh = '';
|
||||
$sizhfin = '';
|
||||
|
@ -2157,8 +2159,8 @@ function header_content($mini, $content, $report, &$table, $title = false, $name
|
|||
else {
|
||||
$data[] = "<div style='text-align: right;'>" . $sizh .
|
||||
"(" . human_time_description_raw ($content['period']) . ") " .
|
||||
__("From:") . " " . date("Y-m-d H:i", $report["datetime"] - $content['period']) . "<br />" .
|
||||
__("To:") . " " . date("Y-m-d H:i", $report["datetime"]) . "<br />" .
|
||||
__("From:") . " " . date($config["date_format"], $report["datetime"]) . "<br />" .
|
||||
__("To:") . " " . date($config["date_format"], $report["datetime"] - $content['period']) . "<br />" .
|
||||
$sizhfin . "</div>";
|
||||
}
|
||||
|
||||
|
@ -2214,7 +2216,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
switch ($content["type"]) {
|
||||
case 1:
|
||||
case 'simple_graph':
|
||||
header_content($mini, $content, $report, $table, __('Simple graph'),
|
||||
reporting_header_content($mini, $content, $report, $table, __('Simple graph'),
|
||||
ui_print_truncate_text($agent_name, 75, false).' <br> ' . ui_print_truncate_text($module_name, 75, false));
|
||||
|
||||
//RUNNING
|
||||
|
@ -2238,7 +2240,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
|
||||
break;
|
||||
case 'projection_graph':
|
||||
header_content($mini, $content, $report, $table, __('Projection graph'),
|
||||
reporting_header_content($mini, $content, $report, $table, __('Projection graph'),
|
||||
ui_print_truncate_text($agent_name, 75, false).' <br> ' . ui_print_truncate_text($module_name, 75, false));
|
||||
|
||||
//RUNNING
|
||||
|
@ -2287,7 +2289,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
array_push ($table->data, $data);
|
||||
break;
|
||||
case 'prediction_date':
|
||||
header_content($mini, $content, $report, $table, __('Prediction date'),
|
||||
reporting_header_content($mini, $content, $report, $table, __('Prediction date'),
|
||||
ui_print_truncate_text($agent_name, 75, false).' <br> ' . ui_print_truncate_text($module_name, 75, false));
|
||||
|
||||
//RUNNING
|
||||
|
@ -2320,7 +2322,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
array_push ($table->data, $data);
|
||||
break;
|
||||
case 'simple_baseline_graph':
|
||||
header_content($mini, $content, $report, $table, __('Simple baseline graph'),
|
||||
reporting_header_content($mini, $content, $report, $table, __('Simple baseline graph'),
|
||||
ui_print_truncate_text($agent_name, 65, false).' <br> ' . ui_print_truncate_text($module_name, 65, false));
|
||||
|
||||
//RUNNING
|
||||
|
@ -2360,7 +2362,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
case 'custom_graph':
|
||||
$graph = db_get_row ("tgraph", "id_graph", $content['id_gs']);
|
||||
|
||||
header_content($mini, $content, $report, $table, __('Custom graph'),
|
||||
reporting_header_content($mini, $content, $report, $table, __('Custom graph'),
|
||||
ui_print_truncate_text($graph['name'], 25, false));
|
||||
|
||||
//RUNNING
|
||||
|
@ -2412,7 +2414,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
break;
|
||||
case 3:
|
||||
case 'SLA':
|
||||
header_content($mini, $content, $report, $table, __('S.L.A.'));
|
||||
reporting_header_content($mini, $content, $report, $table, __('S.L.A.'));
|
||||
|
||||
$show_graph = $content['show_graph'];
|
||||
//RUNNING
|
||||
|
@ -2640,7 +2642,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
break;
|
||||
case 6:
|
||||
case 'monitor_report':
|
||||
header_content($mini, $content, $report, $table, __('Monitor report'),
|
||||
reporting_header_content($mini, $content, $report, $table, __('Monitor report'),
|
||||
ui_print_truncate_text($agent_name, 70, false).' <br> '.ui_print_truncate_text($module_name, 70, false));
|
||||
|
||||
//RUNNING
|
||||
|
@ -2673,7 +2675,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
break;
|
||||
case 7:
|
||||
case 'avg_value':
|
||||
header_content($mini, $content, $report, $table, __('Avg. Value'),
|
||||
reporting_header_content($mini, $content, $report, $table, __('Avg. Value'),
|
||||
ui_print_truncate_text($agent_name, 75, false).' <br> '.ui_print_truncate_text($module_name, 75, false));
|
||||
|
||||
//RUNNING
|
||||
|
@ -2702,7 +2704,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
break;
|
||||
case 8:
|
||||
case 'max_value':
|
||||
header_content($mini, $content, $report, $table, __('Max. Value'),
|
||||
reporting_header_content($mini, $content, $report, $table, __('Max. Value'),
|
||||
ui_print_truncate_text($agent_name, 75, false).' <br> ' . ui_print_truncate_text($module_name, 75, false));
|
||||
|
||||
//RUNNING
|
||||
|
@ -2726,7 +2728,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
break;
|
||||
case 9:
|
||||
case 'min_value':
|
||||
header_content($mini, $content, $report, $table, __('Min. Value'),
|
||||
reporting_header_content($mini, $content, $report, $table, __('Min. Value'),
|
||||
ui_print_truncate_text($agent_name, 75, false).' <br> '.ui_print_truncate_text($module_name, 75, false));
|
||||
|
||||
//RUNNING
|
||||
|
@ -2755,7 +2757,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
break;
|
||||
case 10:
|
||||
case 'sumatory':
|
||||
header_content($mini, $content, $report, $table, __('Summatory'),
|
||||
reporting_header_content($mini, $content, $report, $table, __('Summatory'),
|
||||
ui_print_truncate_text($agent_name, 75, false).' <br> '.ui_print_truncate_text($module_name, 75, false));
|
||||
|
||||
//RUNNING
|
||||
|
@ -2786,7 +2788,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
break;
|
||||
case 'agent_detailed_event':
|
||||
case 'event_report_agent':
|
||||
header_content($mini, $content, $report, $table, __('Agent detailed event'),
|
||||
reporting_header_content($mini, $content, $report, $table, __('Agent detailed event'),
|
||||
ui_print_truncate_text(agents_get_name($content['id_agent']), 75, false));
|
||||
|
||||
//RUNNING
|
||||
|
@ -2805,7 +2807,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
array_push ($table->data, $data);
|
||||
break;
|
||||
case 'text':
|
||||
header_content($mini, $content, $report, $table, __('Text'),
|
||||
reporting_header_content($mini, $content, $report, $table, __('Text'),
|
||||
"", "");
|
||||
|
||||
if ($content["description"] != ""){
|
||||
|
@ -2818,7 +2820,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
$table->colspan[2][0] = 2;
|
||||
break;
|
||||
case 'sql':
|
||||
header_content($mini, $content, $report, $table, __('SQL'),
|
||||
reporting_header_content($mini, $content, $report, $table, __('SQL'),
|
||||
"", "");
|
||||
|
||||
// Put description at the end of the module (if exists)
|
||||
|
@ -2888,7 +2890,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
case 'sql_graph_pie':
|
||||
case 'sql_graph_vbar':
|
||||
case 'sql_graph_hbar':
|
||||
header_content($mini, $content, $report, $table, __('User defined graph') . " (".__($content["type"]) .")",
|
||||
reporting_header_content($mini, $content, $report, $table, __('User defined graph') . " (".__($content["type"]) .")",
|
||||
"", "");
|
||||
|
||||
// Put description at the end of the module (if exists)
|
||||
|
@ -2916,7 +2918,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
break;
|
||||
|
||||
case 'event_report_group':
|
||||
header_content($mini, $content, $report, $table, __('Group detailed event'),
|
||||
reporting_header_content($mini, $content, $report, $table, __('Group detailed event'),
|
||||
ui_print_truncate_text(groups_get_name($content['id_group'], true), 60, false));
|
||||
|
||||
// Put description at the end of the module (if exists)
|
||||
|
@ -2934,7 +2936,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
break;
|
||||
|
||||
case 'event_report_module':
|
||||
header_content($mini, $content, $report, $table, __('Module detailed event'),
|
||||
reporting_header_content($mini, $content, $report, $table, __('Module detailed event'),
|
||||
ui_print_truncate_text($agent_name, 70, false).' <br> ' . ui_print_truncate_text($module_name, 70, false));
|
||||
|
||||
// Put description at the end of the module (if exists)
|
||||
|
@ -2951,7 +2953,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
array_push ($table->data, $data);
|
||||
break;
|
||||
case 'alert_report_module':
|
||||
header_content($mini, $content, $report, $table, __('Alert report module'),
|
||||
reporting_header_content($mini, $content, $report, $table, __('Alert report module'),
|
||||
ui_print_truncate_text($agent_name, 70, false).' <br> '.ui_print_truncate_text($module_name, 70, false));
|
||||
|
||||
// Put description at the end of the module (if exists)
|
||||
|
@ -2968,7 +2970,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
array_push ($table->data, $data);
|
||||
break;
|
||||
case 'alert_report_agent':
|
||||
header_content($mini, $content, $report, $table, __('Alert report agent'),
|
||||
reporting_header_content($mini, $content, $report, $table, __('Alert report agent'),
|
||||
ui_print_truncate_text($agent_name, 70, false));
|
||||
|
||||
// Put description at the end of the module (if exists)
|
||||
|
@ -2985,7 +2987,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
array_push ($table->data, $data);
|
||||
break;
|
||||
case 'url':
|
||||
header_content($mini, $content, $report, $table, __('Import text from URL'),
|
||||
reporting_header_content($mini, $content, $report, $table, __('Import text from URL'),
|
||||
ui_print_truncate_text($content["external_source"], 70, false));
|
||||
|
||||
// Put description at the end of the module (if exists)
|
||||
|
@ -3007,7 +3009,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
array_push ($table->data, $data);
|
||||
break;
|
||||
case 'database_serialized':
|
||||
header_content($mini, $content, $report, $table, __('Serialize data'),
|
||||
reporting_header_content($mini, $content, $report, $table, __('Serialize data'),
|
||||
ui_print_truncate_text($module_name, 75, false));
|
||||
|
||||
// Put description at the end of the module (if exists)
|
||||
|
@ -3065,7 +3067,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
$table->colspan[1][0] = 2;
|
||||
break;
|
||||
case 'TTRT':
|
||||
header_content($mini, $content, $report, $table, __('TTRT'),
|
||||
reporting_header_content($mini, $content, $report, $table, __('TTRT'),
|
||||
ui_print_truncate_text($agent_name, 70, false).' <br> '.ui_print_truncate_text($module_name, 70, false));
|
||||
|
||||
// Put description at the end of the module (if exists)
|
||||
|
@ -3091,7 +3093,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
array_push ($table->data, $data);
|
||||
break;
|
||||
case 'TTO':
|
||||
header_content($mini, $content, $report, $table, __('TTO'),
|
||||
reporting_header_content($mini, $content, $report, $table, __('TTO'),
|
||||
ui_print_truncate_text($agent_name, 70, false).' <br> '.ui_print_truncate_text($module_name, 70, false));
|
||||
|
||||
// Put description at the end of the module (if exists)
|
||||
|
@ -3117,7 +3119,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
array_push ($table->data, $data);
|
||||
break;
|
||||
case 'MTBF':
|
||||
header_content($mini, $content, $report, $table, __('MTBF'),
|
||||
reporting_header_content($mini, $content, $report, $table, __('MTBF'),
|
||||
ui_print_truncate_text($agent_name, 70, false).' <br> '.ui_print_truncate_text($module_name, 70, false));
|
||||
|
||||
// Put description at the end of the module (if exists)
|
||||
|
@ -3143,7 +3145,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
array_push ($table->data, $data);
|
||||
break;
|
||||
case 'MTTR':
|
||||
header_content($mini, $content, $report, $table, __('MTTR'),
|
||||
reporting_header_content($mini, $content, $report, $table, __('MTTR'),
|
||||
ui_print_truncate_text($agent_name, 70, false).' <br> '.ui_print_truncate_text($module_name, 70, false));
|
||||
|
||||
// Put description at the end of the module (if exists)
|
||||
|
@ -3174,7 +3176,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
// Get events of the last 8 hours
|
||||
$events = events_get_group_events ($content['id_group'], 28800, $report['datetime']);
|
||||
|
||||
header_content($mini, $content, $report, $table, __('Group report').': "'.$group_name.'"');
|
||||
reporting_header_content($mini, $content, $report, $table, __('Group report').': "'.$group_name.'"');
|
||||
|
||||
$data = array ();
|
||||
$table->colspan[0][0] = 7;
|
||||
|
@ -3245,7 +3247,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
|
||||
break;
|
||||
case 'general':
|
||||
header_content($mini, $content, $report, $table, __('General'));
|
||||
reporting_header_content($mini, $content, $report, $table, __('General'));
|
||||
|
||||
$group_by_agent = $content['group_by_agent'];
|
||||
$order_uptodown = $content['order_uptodown'];
|
||||
|
@ -3560,7 +3562,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
}
|
||||
break;
|
||||
case 'top_n':
|
||||
header_content($mini, $content, $report, $table, __('Top').' '.$content['top_n_value']);
|
||||
reporting_header_content($mini, $content, $report, $table, __('Top').' '.$content['top_n_value']);
|
||||
|
||||
$order_uptodown = $content['order_uptodown'];
|
||||
$top_n = $content['top_n'];
|
||||
|
@ -3662,16 +3664,16 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
switch ($top_n) {
|
||||
//Max
|
||||
case 1:
|
||||
array_multisort($data_top, SORT_DESC, $agent_name, SORT_ASC, $module_name, SORT_ASC, $id_agent_module, SORT_ASC);
|
||||
array_multisort($data_top, SORT_DESC, $agent_name, SORT_ASC, $module_name, SORT_ASC, $id_agent_module, SORT_ASC, $units, SORT_ASC);
|
||||
break;
|
||||
//Min
|
||||
case 2:
|
||||
array_multisort($data_top, SORT_ASC, $agent_name, SORT_ASC, $module_name, SORT_ASC, $id_agent_module, SORT_ASC);
|
||||
array_multisort($data_top, SORT_ASC, $agent_name, SORT_ASC, $module_name, SORT_ASC, $id_agent_module, SORT_ASC, $units, SORT_ASC);
|
||||
break;
|
||||
//By agent name or without selection
|
||||
case 0:
|
||||
case 3:
|
||||
array_multisort($agent_name, SORT_ASC, $data_top, SORT_ASC, $module_name, SORT_ASC, $id_agent_module, SORT_ASC);
|
||||
array_multisort($agent_name, SORT_ASC, $data_top, SORT_ASC, $module_name, SORT_ASC, $id_agent_module, SORT_ASC, $units, SORT_ASC);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -3689,16 +3691,16 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
switch ($order_uptodown) {
|
||||
//Descending
|
||||
case 1:
|
||||
array_multisort($data_top, SORT_DESC, $agent_name, SORT_ASC, $module_name, SORT_ASC, $id_agent_module, SORT_ASC);
|
||||
array_multisort($data_top, SORT_DESC, $agent_name, SORT_ASC, $module_name, SORT_ASC, $id_agent_module, SORT_ASC, $units, SORT_ASC);
|
||||
break;
|
||||
//Ascending
|
||||
case 2:
|
||||
array_multisort($data_top, SORT_ASC, $agent_name, SORT_ASC, $module_name, SORT_ASC, $id_agent_module, SORT_ASC);
|
||||
array_multisort($data_top, SORT_ASC, $agent_name, SORT_ASC, $module_name, SORT_ASC, $id_agent_module, SORT_ASC, $units, SORT_ASC);
|
||||
break;
|
||||
//By agent name or without selection
|
||||
case 0:
|
||||
case 3:
|
||||
array_multisort($agent_name, SORT_ASC, $data_top, SORT_ASC, $module_name, SORT_ASC, $id_agent_module, SORT_ASC);
|
||||
array_multisort($agent_name, SORT_ASC, $data_top, SORT_ASC, $module_name, SORT_ASC, $id_agent_module, SORT_ASC, $units, SORT_ASC);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -3848,7 +3850,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
$title_exeption .= ' - '.__('Modules at critical or warning status');
|
||||
break;
|
||||
}
|
||||
header_content($mini, $content, $report, $table, $title_exeption);
|
||||
reporting_header_content($mini, $content, $report, $table, $title_exeption);
|
||||
|
||||
// Put description at the end of the module (if exists)
|
||||
$table->colspan[1][0] = 3;
|
||||
|
@ -4099,7 +4101,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
}
|
||||
break;
|
||||
case 'agent_module':
|
||||
header_content($mini, $content, $report, $table, __('Agents/Modules'));
|
||||
reporting_header_content($mini, $content, $report, $table, __('Agents/Modules'));
|
||||
|
||||
$id_group = $content['id_group'];
|
||||
$id_module_group = $content['id_module_group'];
|
||||
|
@ -4178,7 +4180,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
continue;
|
||||
}
|
||||
|
||||
$file_name = string2image(ui_print_truncate_text($module['name'], 30, false, true, false, '...'), false, false, 6, 270, '#9EAC8B', 'FFF', 4, 0);
|
||||
$file_name = string2image(ui_print_truncate_text($module['name'], 30, false, true, false, '...'), false, false, 6, 270, '#90B165', 'FFF', 4, 0);
|
||||
$table_data .= '<th width="22px">'.html_print_image($file_name, true, array('title' => $module['name']))."</th>";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue