diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index a71214396c..4e6a3cd6c7 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -6147,7 +6147,13 @@ function reporting_advanced_sla( $time_total += $time_interval; if ($time_interval > 0) { - $total_checks++; + if (isset($current_data['type']) === false + || ((int) $current_data['type'] === 0 + && $i !== 0) + ) { + $total_checks++; + } + if ((isset($current_data['datos'])) && ($current_data['datos'] !== false) ) { @@ -6159,7 +6165,7 @@ function reporting_advanced_sla( $match = preg_match('/'.$max_value.'/', $current_data['datos']); } - // Take notice of $inverse_interval value, + // Take notice of $inverse_interval value. if ($inverse_interval == 0) { $sla_check_value = $match; } else { @@ -6176,19 +6182,41 @@ function reporting_advanced_sla( // Not unknown nor not init values. if ($sla_check_value) { - $ok_checks++; + if (isset($current_data['type']) === false + || ((int) $current_data['type'] === 0 + && $i !== 0) + ) { + $ok_checks++; + } + $time_in_ok += $time_interval; } else { - $bad_checks++; + if (isset($current_data['type']) === false + || ((int) $current_data['type'] === 0 + && $i !== 0) + ) { + $bad_checks++; + } + $time_in_error += $time_interval; } } else { if ($current_data['datos'] === null) { $time_in_unknown += $time_interval; - $unknown_checks++; + if (isset($current_data['type']) === false + || ((int) $current_data['type'] === 0 + && $i !== 0) + ) { + $unknown_checks++; + } } else if ($current_data['datos'] === false) { $time_in_not_init += $time_interval; - $not_init_checks++; + if (isset($current_data['type']) === false + || ((int) $current_data['type'] === 0 + && $i !== 0) + ) { + $not_init_checks++; + } } } }