diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 0fc5a4ffac..360c52349b 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2013-02-28 Miguel de Dios + + * include/functions_reporting.php: fixed php warning message when + calculate the server healty without servers. + 2013-02-28 Miguel de Dios * include/functions_config.php: added code to set the config options diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index c74ccf13d4..fad24893fb 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -1195,7 +1195,12 @@ function reporting_get_stats_indicators($data, $width = 280, $height = 20) { $servers["all"] = (int) db_get_value ('COUNT(id_server)','tserver'); $servers["up"] = (int) servers_check_status (); $servers["down"] = $servers["all"] - $servers["up"]; - $servers["health"] = $servers["up"] / ($servers["all"] / 100); + if ($servers["all"] == 0) { + $servers["health"] = 0; + } + else { + $servers["health"] = $servers["up"] / ($servers["all"] / 100); + } $tdata[0] = '
' .