From 6f2b50af569f2b12e88f36fff7a4a91d8fe5a017 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 4 Jan 2023 11:16:51 +0100 Subject: [PATCH 1/2] #9362 Change getInforTAgenteDatos count alert --- pandora_console/include/class/Diagnostics.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/class/Diagnostics.class.php b/pandora_console/include/class/Diagnostics.class.php index db9f459f00..768d0c1204 100644 --- a/pandora_console/include/class/Diagnostics.class.php +++ b/pandora_console/include/class/Diagnostics.class.php @@ -1276,11 +1276,16 @@ class Diagnostics extends Wizard FROM tagente_datos' ); + $modulesDataCount = db_get_value_sql( + 'SELECT COUNT(*) * 300 as total FROM tmodule_inventory' + ); + $modulesDataCount = ($modulesDataCount >= 500000) ? $modulesDataCount : 500000; + $taMsg = __( 'The tagente_datos table contains too much data. A historical database is recommended.' ); $taStatus = 0; - if ($agentDataCount <= 3000000) { + if ($agentDataCount <= $modulesDataCount) { $taMsg = __( 'The tagente_datos table contains an acceptable amount of data.' ); From bc6893b83efdc439056b7d240e71e9768c24f2ca Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 4 Jan 2023 11:36:26 +0100 Subject: [PATCH 2/2] #9362 Change sql for count modules from tagente_datos --- pandora_console/include/class/Diagnostics.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/class/Diagnostics.class.php b/pandora_console/include/class/Diagnostics.class.php index 768d0c1204..a60cb7cf77 100644 --- a/pandora_console/include/class/Diagnostics.class.php +++ b/pandora_console/include/class/Diagnostics.class.php @@ -1277,7 +1277,7 @@ class Diagnostics extends Wizard ); $modulesDataCount = db_get_value_sql( - 'SELECT COUNT(*) * 300 as total FROM tmodule_inventory' + 'SELECT count(*) * 300 FROM (SELECT * FROM tagente_datos GROUP BY id_agente_modulo) AS totalmodules' ); $modulesDataCount = ($modulesDataCount >= 500000) ? $modulesDataCount : 500000;