From 0c4a3f604711675e176ec11e56e8c7f9d3d1764e Mon Sep 17 00:00:00 2001 From: slerena Date: Wed, 21 Jan 2009 10:02:47 +0000 Subject: [PATCH] 2009-01-21 Sancho Lerena * pandoradb_data.sql: Updated DB Schema version/build. * operation/agentes/status_monitor.php operation/agentes/estado_agente.php: operation/agentes/estado_ultimopaquete.php, operation/agentes/estado_monitores.php: Manage correctly async modules including keepalive. Show servertype with moduletype icon. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1379 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 10 ++++++++++ pandora_console/operation/agentes/estado_agente.php | 6 +++--- pandora_console/operation/agentes/estado_monitores.php | 6 +++--- .../operation/agentes/estado_ultimopaquete.php | 4 +++- pandora_console/operation/agentes/status_monitor.php | 2 +- pandora_console/pandoradb_data.sql | 4 ++-- 6 files changed, 22 insertions(+), 10 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 5a4675163e..486e3c88a7 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,13 @@ +2009-01-21 Sancho Lerena + + * pandoradb_data.sql: Updated DB Schema version/build. + + * operation/agentes/status_monitor.php + operation/agentes/estado_agente.php: + operation/agentes/estado_ultimopaquete.php, + operation/agentes/estado_monitores.php: Manage correctly async modules + including keepalive. Show servertype with moduletype icon. + 2009-01-21 Esteban Sanchez * pandoradb.sql, pandoradb_migrate_20_to_21.sql: Added id_agent field diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index 85dcc8ca03..cf3055f131 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -207,13 +207,13 @@ if ($agents !== false) { $seconds = $now - strtotime ($ultimo_contacto_modulo); else $seconds = -1; - if ($module_type < 21 || $module_type == 100) { + if ($module_type < 21 || $module_type != 100) { $async = 0; } else { $async = 1; } - // Defines if Agent is down (interval x 2 > time last contact - if ($seconds >= ($intervalo_comp * 2)) { // If (intervalx2) secs. ago we don't get anything, show alert + // Defines if Agent is down (interval x 2 > time last contact + if (($seconds >= ($intervalo_comp * 2)) AND ($module_type < 21)) { // If (intervalx2) secs. ago we don't get anything, show alert $agent_down = 1; if ($async == 0) $monitor_down++; diff --git a/pandora_console/operation/agentes/estado_monitores.php b/pandora_console/operation/agentes/estado_monitores.php index 7fad6bf05b..f9c0209dd9 100644 --- a/pandora_console/operation/agentes/estado_monitores.php +++ b/pandora_console/operation/agentes/estado_monitores.php @@ -65,8 +65,8 @@ foreach ($modules as $module) { } else { $data[0] = ''; } - - $data[1] = ''; + $data[1] = show_server_type ($module['id_modulo']); + $data[1] .= ' '; if (give_acl ($config['id_user'], $id_grupo, "AW")) $data[1] .= ''; $data[2] = substr ($module["nombre"], 0, 25); @@ -93,7 +93,7 @@ foreach ($modules as $module) { } $seconds = get_system_time () - $module["utimestamp"]; - if ($module["current_interval"] > 0 && $module["utimestamp"] > 0 && $seconds >= ($module["current_interval"] * 2)) { + if ($module['id_tipo_modulo'] < 21 && $module["current_interval"] > 0 && $module["utimestamp"] > 0 && $seconds >= ($module["current_interval"] * 2)) { $data[6] = ''; } else { $data[6] = ''; diff --git a/pandora_console/operation/agentes/estado_ultimopaquete.php b/pandora_console/operation/agentes/estado_ultimopaquete.php index 2138b99553..a4d627dccf 100644 --- a/pandora_console/operation/agentes/estado_ultimopaquete.php +++ b/pandora_console/operation/agentes/estado_ultimopaquete.php @@ -109,7 +109,9 @@ if (mysql_num_rows ($result3)) { echo ""; echo salida_limpia(substr($row3["nombre"],0,15)); echo ""; - echo ""; + + echo show_server_type ($row3['id_modulo']); + echo " "; if (give_acl ($config['id_user'], $id_grupo, "AW")) echo ''; diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index 66db9bf0b2..57127acd33 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -133,7 +133,7 @@ if ($status == 0) { //Up } elseif ($status == 4) { //not normal $sql .= " AND ((UNIX_TIMESTAMP(NOW()) - tagente_estado.utimestamp) >= (tagente_estado.current_interval * 2) OR tagente_estado.estado = 2 OR tagente_estado.estado = 1) "; } elseif ($status == 3) { //Unknown - $sql .= " AND (UNIX_TIMESTAMP(NOW()) - tagente_estado.utimestamp) >= (tagente_estado.current_interval * 2)"; + $sql .= " AND tagente_modulo.id_tipo_modulo < 21 AND (UNIX_TIMESTAMP(NOW()) - tagente_estado.utimestamp) >= (tagente_estado.current_interval * 2)"; } $sql .= " ORDER BY tagente.id_grupo, tagente.nombre"; diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 04df39751b..d31409f631 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -50,8 +50,8 @@ INSERT INTO `tconfig` VALUES (5,'days_compact','15'), (6,'graph_res','5'), (7,'step_compact','1'), -(8,'db_scheme_version','2.0'), -(9,'db_scheme_build','PD80901'), +(8,'db_scheme_version','2.1-dev'), +(9,'db_scheme_build','PD90121'), (13,'show_unknown','0'), (14,'show_lastalerts','1'), (15,'style','pandora'),