diff --git a/pandora_console/include/functions_servers.php b/pandora_console/include/functions_servers.php index a58342dddb..bdf5c8026e 100644 --- a/pandora_console/include/functions_servers.php +++ b/pandora_console/include/functions_servers.php @@ -983,12 +983,14 @@ function servers_get_info($id_server=-1) 'SELECT UNIX_TIMESTAMP() - utimestamp FROM trecon_task WHERE UNIX_TIMESTAMP() > (utimestamp + interval_sweep) + AND interval_sweep > 0 AND id_recon_server = '.$server['id_server'] ); $server['module_lag'] = db_get_sql( 'SELECT COUNT(id_rt) FROM trecon_task WHERE UNIX_TIMESTAMP() > (utimestamp + interval_sweep) + AND interval_sweep > 0 AND id_recon_server = '.$server['id_server'] ); } else { diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 4726df4710..76f104ab7f 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -5639,9 +5639,9 @@ sub pandora_server_statistics ($$) { # Lag (take average active time of all active tasks) - $server->{"lag"} = get_db_value ($dbh, "SELECT UNIX_TIMESTAMP() - utimestamp from trecon_task WHERE UNIX_TIMESTAMP() > (utimestamp + interval_sweep) AND id_recon_server = ?", $server->{"id_server"}); + $server->{"lag"} = get_db_value ($dbh, "SELECT UNIX_TIMESTAMP() - utimestamp from trecon_task WHERE UNIX_TIMESTAMP() > (utimestamp + interval_sweep) AND interval_sweep > 0 AND id_recon_server = ?", $server->{"id_server"}); - $server->{"module_lag"} = get_db_value ($dbh, "SELECT COUNT(id_rt) FROM trecon_task WHERE UNIX_TIMESTAMP() > (utimestamp + interval_sweep) AND id_recon_server = ?", $server->{"id_server"}); + $server->{"module_lag"} = get_db_value ($dbh, "SELECT COUNT(id_rt) FROM trecon_task WHERE UNIX_TIMESTAMP() > (utimestamp + interval_sweep) AND interval_sweep AND id_recon_server = ?", $server->{"id_server"}); } else {