mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-09-26 11:29:12 +02:00
2013-05-23 Miguel de Dios <miguel.dedios@artica.es>
* godmode/reporting/reporting_builder.item_editor.php, include/functions_reporting.php: change the title of "avg" for the real "rate". Fixes: #2223 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8197 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
b8c07fda76
commit
4310835323
@ -1,3 +1,11 @@
|
|||||||
|
2013-05-23 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* godmode/reporting/reporting_builder.item_editor.php,
|
||||||
|
include/functions_reporting.php: change the title of "avg" for
|
||||||
|
the real "rate".
|
||||||
|
|
||||||
|
Fixes: #2223
|
||||||
|
|
||||||
2013-05-23 Miguel de Dios <miguel.dedios@artica.es>
|
2013-05-23 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
* godmode/reporting/reporting_builder.item_editor.php: fixed ACL for
|
* godmode/reporting/reporting_builder.item_editor.php: fixed ACL for
|
||||||
|
@ -1309,7 +1309,13 @@ function print_General_list($width, $action, $idItem = null) {
|
|||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
<td><select id="id_agent_module_general" name="id_agente_modulo_general" disabled="disabled" style="max-width: 180px"><option value="0"><?php echo __('Select an Agent first'); ?></option></select></td>
|
<td><select id="id_agent_module_general" name="id_agente_modulo_general" disabled="disabled" style="max-width: 180px"><option value="0"><?php echo __('Select an Agent first'); ?></option></select></td>
|
||||||
<?php $operation = array ('avg'=>'avg','max'=>'max','min'=>'min','sum'=>'sum'); ?>
|
<?php
|
||||||
|
$operation = array(
|
||||||
|
'avg' => __('rate'),
|
||||||
|
'max' => __('max'),
|
||||||
|
'min' => __('min'),
|
||||||
|
'sum' => __('sum'));
|
||||||
|
?>
|
||||||
<td><?php html_print_select ($operation, 'id_operation_module_general', 0, false, '', '', false, false, true, 'width: 200px', false); ?></td>
|
<td><?php html_print_select ($operation, 'id_operation_module_general', 0, false, '', '', false, false, true, 'width: 200px', false); ?></td>
|
||||||
<td style="text-align: center;"><a href="javascript: addGeneralRow();"><?php html_print_image("images/disk.png", false); ?></a></td>
|
<td style="text-align: center;"><a href="javascript: addGeneralRow();"><?php html_print_image("images/disk.png", false); ?></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -4483,17 +4483,25 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
|
|
||||||
switch ($row['operation']) {
|
switch ($row['operation']) {
|
||||||
case 'sum':
|
case 'sum':
|
||||||
$data_res[$key] = reporting_get_agentmodule_data_sum ($row['id_agent_module'], $content['period'], $report["datetime"]);
|
$data_res[$key] =
|
||||||
|
reporting_get_agentmodule_data_sum(
|
||||||
|
$row['id_agent_module'], $content['period'], $report["datetime"]);
|
||||||
break;
|
break;
|
||||||
case 'max':
|
case 'max':
|
||||||
$data_res[$key] = reporting_get_agentmodule_data_max ($row['id_agent_module'], $content['period']);
|
$data_res[$key] =
|
||||||
|
reporting_get_agentmodule_data_max(
|
||||||
|
$row['id_agent_module'], $content['period']);
|
||||||
break;
|
break;
|
||||||
case 'min':
|
case 'min':
|
||||||
$data_res[$key] = reporting_get_agentmodule_data_min ($row['id_agent_module'], $content['period']);
|
$data_res[$key] =
|
||||||
|
reporting_get_agentmodule_data_min(
|
||||||
|
$row['id_agent_module'], $content['period']);
|
||||||
break;
|
break;
|
||||||
case 'avg':
|
case 'avg':
|
||||||
default:
|
default:
|
||||||
$data_res[$key] = reporting_get_agentmodule_data_average ($row['id_agent_module'], $content['period']);
|
$data_res[$key] =
|
||||||
|
reporting_get_agentmodule_data_average(
|
||||||
|
$row['id_agent_module'], $content['period']);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4553,7 +4561,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
break;
|
break;
|
||||||
case 'avg':
|
case 'avg':
|
||||||
default:
|
default:
|
||||||
$op = __('Average');
|
$op = __('Rate');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$data[2] = $op;
|
$data[2] = $op;
|
||||||
@ -5201,34 +5209,47 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
|
|
||||||
$table->style[1] = 'text-align: right';
|
$table->style[1] = 'text-align: right';
|
||||||
|
|
||||||
$title_exeption = __('Exception');
|
|
||||||
switch ($exception_condition) {
|
switch ($exception_condition) {
|
||||||
case REPORT_EXCEPTION_CONDITION_EVERYTHING:
|
case REPORT_EXCEPTION_CONDITION_EVERYTHING:
|
||||||
$title_exeption .= ' - '.__('Everything');
|
$title_exeption = __('Exception - Everything');
|
||||||
break;
|
break;
|
||||||
case REPORT_EXCEPTION_CONDITION_GE:
|
case REPORT_EXCEPTION_CONDITION_GE:
|
||||||
$title_exeption .= ' - '.__('Modules over or equal to').' '.$exception_condition_value;
|
$title_exeption =
|
||||||
|
sprintf(__('Exception - Modules over or equal to %s'),
|
||||||
|
$exception_condition_value);
|
||||||
break;
|
break;
|
||||||
case REPORT_EXCEPTION_CONDITION_LE:
|
case REPORT_EXCEPTION_CONDITION_LE:
|
||||||
$title_exeption .= ' - '.__('Modules under or equal to').' '.$exception_condition_value;
|
$title_exeption =
|
||||||
|
sprintf(__('Exception - Modules under or equal to %s'),
|
||||||
|
$exception_condition_value);
|
||||||
break;
|
break;
|
||||||
case REPORT_EXCEPTION_CONDITION_L:
|
case REPORT_EXCEPTION_CONDITION_L:
|
||||||
$title_exeption .= ' - '.__('Modules under').' '.$exception_condition_value;
|
$title_exeption =
|
||||||
|
sprintf(__('Exception - Modules under %s'),
|
||||||
|
$exception_condition_value);
|
||||||
break;
|
break;
|
||||||
case REPORT_EXCEPTION_CONDITION_G:
|
case REPORT_EXCEPTION_CONDITION_G:
|
||||||
$title_exeption .= ' - '.__('Modules over').' '.$exception_condition_value;
|
$title_exeption =
|
||||||
|
sprintf(__('Exception - Modules over %s'),
|
||||||
|
$exception_condition_value);
|
||||||
break;
|
break;
|
||||||
case REPORT_EXCEPTION_CONDITION_E:
|
case REPORT_EXCEPTION_CONDITION_E:
|
||||||
$title_exeption .= ' - '.__('Equal to').' '.$exception_condition_value;
|
$title_exeption =
|
||||||
|
sprintf(__('Exception - Equal to'),
|
||||||
|
$exception_condition_value);
|
||||||
break;
|
break;
|
||||||
case REPORT_EXCEPTION_CONDITION_NE:
|
case REPORT_EXCEPTION_CONDITION_NE:
|
||||||
$title_exeption .= ' - '.__('Not equal to').' '.$exception_condition_value;
|
$title_exeption =
|
||||||
|
sprintf(__('Exception - Not equal to %s'),
|
||||||
|
$exception_condition_value);
|
||||||
break;
|
break;
|
||||||
case REPORT_EXCEPTION_CONDITION_OK:
|
case REPORT_EXCEPTION_CONDITION_OK:
|
||||||
$title_exeption .= ' - '.__('Modules at normal status');
|
$title_exeption =
|
||||||
|
__('Exception - Modules at normal status');
|
||||||
break;
|
break;
|
||||||
case REPORT_EXCEPTION_CONDITION_NOT_OK:
|
case REPORT_EXCEPTION_CONDITION_NOT_OK:
|
||||||
$title_exeption .= ' - '.__('Modules at critical or warning status');
|
$title_exeption =
|
||||||
|
__('Exception - Modules at critical or warning status');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5242,7 +5263,8 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
array_push ($table->data, $data_desc);
|
array_push ($table->data, $data_desc);
|
||||||
}
|
}
|
||||||
//Get all the related data
|
//Get all the related data
|
||||||
$sql = sprintf("SELECT id_agent_module, server_name, operation
|
$sql = sprintf("
|
||||||
|
SELECT id_agent_module, server_name, operation
|
||||||
FROM treport_content_item
|
FROM treport_content_item
|
||||||
WHERE id_report_content = %d", $content['id_rc']);
|
WHERE id_report_content = %d", $content['id_rc']);
|
||||||
|
|
||||||
@ -5318,7 +5340,8 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
|
|
||||||
$ag_name = modules_get_agentmodule_agent_name ($exc ['id_agent_module']);
|
$ag_name = modules_get_agentmodule_agent_name ($exc ['id_agent_module']);
|
||||||
$mod_name = modules_get_agentmodule_name ($exc ['id_agent_module']);
|
$mod_name = modules_get_agentmodule_name ($exc ['id_agent_module']);
|
||||||
$unit = db_get_value('unit', 'tagente_modulo', 'id_agente_modulo', $exc ['id_agent_module']);
|
$unit = db_get_value('unit', 'tagente_modulo',
|
||||||
|
'id_agente_modulo', $exc['id_agent_module']);
|
||||||
|
|
||||||
switch ($exc['operation']) {
|
switch ($exc['operation']) {
|
||||||
case 'avg':
|
case 'avg':
|
||||||
@ -5389,8 +5412,13 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
$agent_name[] = $ag_name;
|
$agent_name[] = $ag_name;
|
||||||
$module_name[] = $mod_name;
|
$module_name[] = $mod_name;
|
||||||
$units[] = $unit;
|
$units[] = $unit;
|
||||||
|
if ($exc['operation'] == 'avg') {
|
||||||
|
$operation[] = "rate";
|
||||||
|
}
|
||||||
|
else {
|
||||||
$operation[] = $exc['operation'];
|
$operation[] = $exc['operation'];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//Restore dbconnection
|
//Restore dbconnection
|
||||||
if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user