From 4cd81032ceb01aff716a599b9e8870c1b6653caa Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 16 Dec 2009 11:19:09 +0000 Subject: [PATCH] 2009-12-14 Miguel de Dios * include/functions_servers.php: tiny fix (a zero division) the tactical view when start with a empty Pandora. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2202 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/include/functions_servers.php | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) 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).