[SLA] Fixed availability graphs and SLA calculation

This commit is contained in:
fermin831 2018-04-13 15:02:54 +02:00
parent 38ea279b96
commit 075a89a8b7
2 changed files with 3 additions and 5 deletions

View File

@ -5333,7 +5333,6 @@ function reporting_advanced_sla ($id_agent_module, $time_from = null, $time_to =
// Add downtime interval as OK in inclusion mode
$total_checks++;
$ok_checks++;
$time_in_ok += $wt_check["downtime_interval"];
$time_total += $wt_check["downtime_interval"];
$time_in_down += $wt_check["downtime_interval"];
}
@ -5500,8 +5499,7 @@ function reporting_availability($report, $content, $date=false, $time=false) {
$row = array();
$text = "";
// FIXME: Bad data
$row['data'] = reporting_advanced_sla(
$item['id_agent_module'],
$report["datetime"] - $content['period'],

View File

@ -2427,7 +2427,7 @@ function reporting_html_availability(&$table, $item) {
else
$table_row[] = '--';
$table_row[] = '<span style="font-size: 1.2em; font-weight:bold;">' . sla_truncate($row['SLA'], $config['graph_precision']). '%</span>';
$table_row[] = '<span style="font-size: 1.2em; font-weight:bold;">' . sla_truncate($row['SLA'] * 100, $config['graph_precision']). '%</span>';
$table_row2 = array();
$table_row2[] = $row['agent'];
@ -2473,7 +2473,7 @@ function reporting_html_availability(&$table, $item) {
else
$table_row[] = '--';
$table_row[] = '<span style="font-size: 1.2em; font-weight:bold;">' . sla_truncate($row['SLA'], $config['graph_precision']). '%</span>';
$table_row[] = '<span style="font-size: 1.2em; font-weight:bold;">' . sla_truncate($row['SLA'] * 100, $config['graph_precision']). '%</span>';
$table_row2 = array();
$table_row2[] = $row['agent'];