Data precision, added changes to availability reports

This commit is contained in:
Arturo Gonzalez 2016-10-31 10:05:48 +01:00
parent 829edc592c
commit 6a617a2c0f

View File

@ -3789,8 +3789,6 @@ function reporting_availability($report, $content, $date=false, $time=false) {
else { else {
$items = $content['subitems']; $items = $content['subitems'];
} }
$data = array(); $data = array();
@ -3826,8 +3824,6 @@ function reporting_availability($report, $content, $date=false, $time=false) {
} }
} }
if (modules_is_disable_agent($item['id_agent_module']) if (modules_is_disable_agent($item['id_agent_module'])
|| modules_is_not_init($item['id_agent_module'])) { || modules_is_not_init($item['id_agent_module'])) {
//Restore dbconnection //Restore dbconnection
@ -3890,13 +3886,13 @@ function reporting_availability($report, $content, $date=false, $time=false) {
$percent_ok = 0; $percent_ok = 0;
} }
else { else {
$percent_ok = format_numeric($sla_value, 2); $percent_ok = $sla_value;
$percent_fail = (100 - $percent_ok); $percent_fail = (100 - $percent_ok);
$row['checks'] = format_numeric($count_checks, 0); $row['checks'] = format_numeric($count_checks, 0);
$row['ok'] = format_numeric($percent_ok,2) . " %"; $row['ok'] = $percent_ok . " %";
$row['order'] = $percent_ok; $row['order'] = $percent_ok;
$row['fail'] = format_numeric($percent_fail,2) . " %"; $row['fail'] = $percent_fail . " %";
//$row['failed'] = format_numeric($percent_fail * $count_checks / 100, 0); //$row['failed'] = format_numeric($percent_fail * $count_checks / 100, 0);
//if the value of time in failures is less than those recorded in the database the number of errors that have registered in the database is set //if the value of time in failures is less than those recorded in the database the number of errors that have registered in the database is set