diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index a94d2bcab1..960c28f9c5 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2010-05-04 Miguel de Dios + + * include/functions_reporting.php: fixed the php notice message when the + index not exist in the var $data in the function "get_agentmodule_sla". + 2010-05-04 Sergio Martin * godmode/agentes/agent_template.php: Fixed the diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index be37cb042a..dfc4457b53 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -294,12 +294,15 @@ function get_agentmodule_sla ($id_agentmodule, $period = 0, $min_value = 1, $max $bad_period += $data['utimestamp'] - $previous_utimestamp; } - // Re-calculate previous status for the next data - if ((($max_value > $min_value AND ($data['datos'] > $max_value OR $data['datos'] < $min_value))) OR - ($max_value <= $min_value AND $data['datos'] < $min_value)) { - $previous_status = 1; - } else { - $previous_status = 0; + if (array_key_exists('datos', $data)) { + // Re-calculate previous status for the next data + if ((($max_value > $min_value AND ($data['datos'] > $max_value OR $data['datos'] < $min_value))) OR + ($max_value <= $min_value AND $data['datos'] < $min_value)) { + $previous_status = 1; + } + else { + $previous_status = 0; + } } $previous_utimestamp = $data['utimestamp'];