From 18ad7a2ce9c07b100c7a956b39aaeb05d33ce6b9 Mon Sep 17 00:00:00 2001
From: fermin831 <fermin.hernandez@artica.es>
Date: Wed, 10 Oct 2018 19:13:51 +0200
Subject: [PATCH] [Tags performance] Fixed not init filter

---
 pandora_console/include/functions_modules.php    | 5 +++++
 pandora_console/operation/agentes/ver_agente.php | 1 -
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php
index 491e1f9c10..ac4d11b4ab 100755
--- a/pandora_console/include/functions_modules.php
+++ b/pandora_console/include/functions_modules.php
@@ -2802,6 +2802,11 @@ function modules_get_state_condition($state, $prefix = "tae") {
 				$prefix.estado = ".AGENT_MODULE_STATUS_NORMAL_ALERT."
 				OR $prefix.estado = ".AGENT_MODULE_STATUS_NORMAL."
 			)";
+		case AGENT_MODULE_STATUS_NOT_NORMAL:
+			return "(
+				$prefix.estado <> " . AGENT_MODULE_STATUS_NORMAL . "
+				AND $prefix.estado <> " . AGENT_MODULE_STATUS_NORMAL_ALERT . "
+			)";
 	}
 	// If the state is not an expected state, return no condition
 	return "1=1";
diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php
index e3efd1096e..4f33dd5b4a 100644
--- a/pandora_console/operation/agentes/ver_agente.php
+++ b/pandora_console/operation/agentes/ver_agente.php
@@ -490,7 +490,6 @@ if (is_ajax ()) {
 			asort($result);
 		}
 		else {
-			$modules = agents_get_modules();
 			if($idAgents[0] < 0){
 				if($selection_mode == 'common'){
 					$sql_agent_total = 'SELECT count(*) FROM tagente WHERE disabled=0';