diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index bff8f3dd25..c59932d09a 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2009-12-14 Miguel de Dios + + * include/functions_servers.php: tiny fix (a zero division) the tactical + view when start with a empty Pandora. + 2009-12-14 Miguel de Dios * include/fgraph.php: fix in the function "grafico_modulo_boolean" for diff --git a/pandora_console/include/functions_servers.php b/pandora_console/include/functions_servers.php index ece0664ed9..c382e80229 100644 --- a/pandora_console/include/functions_servers.php +++ b/pandora_console/include/functions_servers.php @@ -73,7 +73,10 @@ function get_server_performance () { $data["avg_interval_remote_modules"] = get_db_sql ("SELECT AVG(module_interval) FROM tagente_modulo, tagente_estado where tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo AND disabled = 0 AND id_modulo != 1 AND module_interval > 0 AND utimestamp > 0"); - $data["remote_modules_rate"] = $data["total_remote_modules"] / $data["avg_interval_remote_modules"]; + if ($data["total_remote_modules"] == 0) + $data["remote_modules_rate"] = 0; + else + $data["remote_modules_rate"] = $data["total_remote_modules"] / $data["avg_interval_remote_modules"]; // For local modules (ignoring local modules with custom invervals for simplicity).