diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php
index 60e793ef4e..8e57f22ecb 100644
--- a/pandora_console/include/functions_reporting_html.php
+++ b/pandora_console/include/functions_reporting_html.php
@@ -2563,27 +2563,28 @@ function reporting_html_availability_graph(&$table, $item, $pdf=0) {
$table1 = new stdClass();
$table1->width = '99%';
$table1->data = array ();
- if (!$hide_notinit_agent) {
- foreach ($item['charts'] as $chart) {
- $table1->data[] = array(
- $chart['agent'] . "
" . $chart['module'],
- $chart['chart'],
- "" . sla_truncate($chart['sla_value'], $config['graph_precision']) . '%',
- "(" . $chart['checks_ok'] . "/" . $chart['checks_total'] . ")"
- );
+ foreach ($item['charts'] as $chart) {
+ switch ($chart['sla_status']) {
+ case REPORT_STATUS_ERR:
+ $color = COL_CRITICAL;
+ break;
+ case REPORT_STATUS_OK:
+ $color = COL_NORMAL;
+ break;
+ default:
+ $color = COL_UNKNOWN;
+ break;
}
+ $table1->data[] = array(
+ $chart['agent'] . "
" . $chart['module'],
+ $chart['chart'],
+ "" .
+ sla_truncate($chart['sla_value'], $config['graph_precision']) . '%' .
+ '',
+ "(" . $chart['checks_ok'] . "/" . $chart['checks_total'] . ")"
+ );
}
- else{
- foreach ($item['charts'] as $chart) {
- $the_first_men_time = get_agent_first_time(io_safe_output($chart['agent']));
- if ($item['date']['to'] > $the_first_men_time) {
- $table1->data[] = array(
- $chart['agent'] . "
" . $chart['module'],
- $chart['chart']);
- }
- }
- }
-
+
if($item['type'] == 'availability_graph'){
//table_legend_graphs;