diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 9c6a3d495e..71a436f08c 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -5914,10 +5914,18 @@ function api_get_module_data($id, $thrash1, $other, $returnType) { ORDER BY utimestamp DESC", $id, $date_start, $date_end); } else { - $sql = sprintf ("SELECT utimestamp, datos - FROM tagente_datos - WHERE id_agente_modulo = %d AND utimestamp > %d - ORDER BY utimestamp DESC", $id, get_system_time () - $periodSeconds); + if ($periodSeconds == null) { + $sql = sprintf ("SELECT utimestamp, datos + FROM tagente_datos + WHERE id_agente_modulo = %d + ORDER BY utimestamp DESC", $id); + } + else { + $sql = sprintf ("SELECT utimestamp, datos + FROM tagente_datos + WHERE id_agente_modulo = %d AND utimestamp > %d + ORDER BY utimestamp DESC", $id, get_system_time () - $periodSeconds); + } } $data['type'] = 'array';