From d810ab010ebc8c85c51d98fac74b6d4ca8c58350 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 11 Nov 2009 08:40:23 +0000 Subject: [PATCH] 2009-11-11 Miguel de Dios * godmode/agentes/configurar_agente.php: fix the web module, change the field to save the request retry. * godmode/agentes/configurar_agente.php: change the query for tactical view the counts of modules before count the disabled modules. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2103 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 +++++++ pandora_console/godmode/agentes/configurar_agente.php | 5 ++++- pandora_console/include/functions_reporting.php | 10 ++++++---- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 9eff4941dc..a03cf9cbc0 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2009-11-11 Miguel de Dios + + * godmode/agentes/configurar_agente.php: fix the web module, change the + field to save the request retry. + * godmode/agentes/configurar_agente.php: change the query for tactical view + the counts of modules before count the disabled modules. + 2009-11-10 Sancho Lerena * pandora_console.spec: Fixed small problem with .spec diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 5565ecc514..4fdb619516 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -427,7 +427,10 @@ if ($update_module || $create_module) { } $ip_target = (string) get_parameter ('ip_target'); $plugin_user = (string) get_parameter ('plugin_user'); - $plugin_pass = (string) get_parameter ('plugin_pass'); + if (get_parameter('id_module_component_type') == 7) + $plugin_pass = (int) get_parameter ('plugin_pass'); + else + $plugin_pass = (string) get_parameter ('plugin_pass'); $plugin_parameter = (string) get_parameter ('plugin_parameter'); $custom_id = (string) get_parameter ('custom_id'); $history_data = (int) get_parameter('history_data'); diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index e66d5a5a37..fc877332c4 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -146,10 +146,12 @@ function get_group_stats ($id_group = 0) { if (empty ($alerts)) $alerts = array (); - $data["monitor_checks"] = (int) get_db_sql ("SELECT COUNT(*) FROM tagente_estado WHERE ".$filter); - $data["monitor_not_init"] = (int) get_db_sql ("SELECT COUNT(*) FROM tagente_estado WHERE ".$filter."AND utimestamp = 0"); - $data["monitor_unknown"] = (int) get_db_sql ("SELECT COUNT(*) FROM tagente_estado WHERE ".$filter."AND utimestamp > 0 AND UNIX_TIMESTAMP() - utimestamp >= current_interval * 2"); - $data["monitor_critical"] = (int) get_db_sql ("SELECT COUNT(*) FROM tagente_estado WHERE ".$filter."AND utimestamp > 0 AND estado = 1 AND UNIX_TIMESTAMP() - utimestamp < current_interval * 2"); + $disabledQuery = "id_agente_modulo IN (SELECT id_agente_modulo FROM tagente_modulo WHERE disabled = 0) AND "; + + $data["monitor_checks"] = (int) get_db_sql ("SELECT COUNT(*) FROM tagente_estado WHERE " . $disabledQuery . $filter); + $data["monitor_not_init"] = (int) get_db_sql ("SELECT COUNT(*) FROM tagente_estado WHERE " . $disabledQuery . $filter."AND utimestamp = 0"); + $data["monitor_unknown"] = (int) get_db_sql ("SELECT COUNT(*) FROM tagente_estado WHERE " . $disabledQuery . $filter."AND utimestamp > 0 AND UNIX_TIMESTAMP() - utimestamp >= current_interval * 2");debugPrint("SELECT COUNT(*) FROM tagente_estado WHERE " . $disabledQuery . $filter."AND utimestamp > 0 AND UNIX_TIMESTAMP() - utimestamp >= current_interval * 2"); + $data["monitor_critical"] = (int) get_db_sql ("SELECT COUNT(*) FROM tagente_estado WHERE " . $disabledQuery . $filter."AND utimestamp > 0 AND estado = 1 AND UNIX_TIMESTAMP() - utimestamp < current_interval * 2"); $data["monitor_warning"] = (int) get_db_sql ("SELECT COUNT(*) FROM tagente_estado WHERE ".$filter."AND utimestamp > 0 AND estado = 2 AND UNIX_TIMESTAMP() - utimestamp < current_interval * 2"); $data["monitor_ok"] = $data["monitor_checks"] - $data["monitor_not_init"] - $data["monitor_unknown"] - $data["monitor_critical"] - $data["monitor_warning"];