From bd2c31a0187de4dacb847cf4a16caa821bca60f5 Mon Sep 17 00:00:00 2001 From: juanmanuelr Date: Wed, 10 Aug 2011 15:01:14 +0000 Subject: [PATCH] 2011-08-10 Juan Manuel Ramon * include/functions_config.php: Fixed premature warning message about db maintenance over a new installation. Fixes: #3371197 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4706 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 +++++++ pandora_console/include/functions_config.php | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 7da2338c67..2bad27c6c1 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2011-08-10 Juan Manuel Ramon + + * include/functions_config.php: Fixed premature warning message about db + maintenance over a new installation. + + Fixes: #3371197 + 2011-08-10 Miguel de Dios * include/functions_menu.php, operation/menu.php, godmode/menu.php: fixed diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index df34f44ea1..839c9256e1 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -714,10 +714,14 @@ function config_check (){ $db_maintance = db_get_sql ("SELECT `value` FROM tconfig WHERE `token` = 'db_maintance'"); $now = date("U"); - + + // First action in order to know if it's a new installation or db maintenance never have been executed + $first_action = db_get_value_filter('utimestamp', 'tsesion', array('1' => '1', 'order' => 'id_sesion ASC')); + $fresh_installation = $now - $first_action; + $resta = $now - $db_maintance; // ~ about 50 hr - if (($db_maintance == "") OR ($resta > 190000)){ + if (($resta > 190000 AND $fresh_installation> 190000)){ $config["alert_cnt"]++; $_SESSION["alert_msg"] .= '

'.__("Database maintance problem").'

'; $_SESSION["alert_msg"] .= __('Your database is not well maintained. Seems that it have more than 48hr without a proper maintance. Please review Pandora FMS documentation about how to execute this maintance process (pandora_db.pl) and enable it as soon as possible').'';