From 2b07cf64618880524e2482862f8e184b3287a963 Mon Sep 17 00:00:00 2001 From: darode Date: Fri, 8 Jun 2012 12:13:26 +0000 Subject: [PATCH] 2012-06-08 Dario Rodriguez * lib/PandoraFMS/Core.pm: Fixed an error counting unknown agents in groups. MERGED FROM 4.0.2 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6458 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 7 +++++++ pandora_server/lib/PandoraFMS/Core.pm | 10 +++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 41e365a188..2cdd5b837d 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,10 @@ +2012-06-08 Dario Rodriguez + + * lib/PandoraFMS/Core.pm: Fixed an error counting + unknown agents in groups. + + MERGED FROM 4.0.2 + 2012-05-31 Ramon Novoa * lib/PandoraFMS/WMIServer.pm: Merged from 4.0 branch. Hide wmic error diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index d63a65b311..29cea1b46e 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -2507,11 +2507,11 @@ sub pandora_group_statistics ($$) { AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.disabled = 0 AND tagente_estado.utimestamp != 0"); $warning = 0 unless defined ($warning); - $unknown = get_db_value ($dbh, "SELECT COUNT(tagente_estado.id_agente_estado) - FROM tagente_estado, tagente, tagente_modulo - WHERE tagente.id_grupo = $group AND tagente.disabled = 0 - AND tagente_estado.id_agente = tagente.id_agente AND tagente_estado.estado = 3 - AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.disabled = 0 AND tagente_estado.utimestamp != 0"); + $unknown = get_db_value ($dbh, "SELECT COUNT(min_estado) FROM + (SELECT MIN(tagente_estado.estado) as min_estado FROM tagente_estado, tagente, tagente_modulo + WHERE tagente.disabled = 0 AND tagente_estado.utimestamp != 0 AND tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo + AND tagente_modulo.disabled = 0 AND tagente_estado.id_agente = tagente.id_agente AND tagente_estado.estado != 0 + AND tagente.id_grupo = $group GROUP BY tagente.id_agente HAVING min_estado = 3) AS S1"); $unknown = 0 unless defined ($unknown); $non_init = get_db_value ($dbh, "SELECT COUNT(tagente_estado.id_agente_estado)