From 42c2d35f001dd616fbc596725c59abd19154d567 Mon Sep 17 00:00:00 2001 From: slerena Date: Fri, 19 Feb 2010 13:08:42 +0000 Subject: [PATCH] 2010-02-19 Sancho Lerena * lib/PandoraFMS/Core.pm: Added comments to new statistical functions. Added support for log4x in statistical functions. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2387 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 5 +++++ pandora_server/lib/PandoraFMS/Core.pm | 23 ++++++++++++++++++----- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 05bbdeef9b..23c6839d43 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,8 @@ +2010-02-19 Sancho Lerena + + * lib/PandoraFMS/Core.pm: Added comments to new statistical functions. + Added support for log4x in statistical functions. + 2010-02-18 Pablo de la ConcepciĆ³n * lib/PandoraFMS/Core.pm: Restored documentation lost in one of the diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index cf591d350d..c06430e2eb 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -1726,7 +1726,11 @@ sub archive_agent_position($$$$$$$$$$) { ########################################################################## -# Process server statistics for statistics table +=head2 C<< pandora_server_statistics (I<$pa_config>, I<$dbh>) >> + +Process server statistics for statistics table + +=cut ########################################################################## sub pandora_server_statistics ($$) { my ($pa_config, $dbh) = @_; @@ -1817,7 +1821,11 @@ sub pandora_server_statistics ($$) { ########################################################################## -# Process system statistics for statistics table +=head2 C<< pandora_group_statistics (I<$pa_config>, I<$dbh>) >> + +Process groups statistics for statistics table + +=cut ########################################################################## sub pandora_group_statistics ($$) { my ($pa_config, $dbh) = @_; @@ -1865,10 +1873,10 @@ sub pandora_group_statistics ($$) { $warning = 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.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.disabled = 0 AND estado = 2 "); - $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.id_agente = tagente_estado.id_agente AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.disabled = 0 AND tagente_modulo.id_tipo_modulo NOT IN (21,22,23,100) AND utimestamp < ( UNIX_TIMESTAMP() - (current_interval * 2))"); + $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.id_agente = tagente_estado.id_agente AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.disabled = 0 AND tagente_modulo.id_tipo_modulo NOT IN (21,22,23,30,100) AND utimestamp < ( UNIX_TIMESTAMP() - (current_interval * 2))"); $non_init = 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.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.disabled = 0 - AND tagente_modulo.id_tipo_modulo NOT IN (21,22,23,100) AND tagente_estado.utimestamp = 0"); + AND tagente_modulo.id_tipo_modulo NOT IN (21,22,23,30,100) AND tagente_estado.utimestamp = 0"); $alerts = get_db_value ($dbh, "SELECT COUNT(talert_template_modules.id) FROM talert_template_modules, tagente_modulo, tagente_estado, tagente WHERE tagente.id_grupo = $group AND tagente_modulo.id_agente = tagente.id_agente AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.disabled = 0 AND tagente.disabled = 0 AND talert_template_modules.id_agent_module = tagente_modulo.id_agente_modulo"); @@ -1886,8 +1894,13 @@ sub pandora_group_statistics ($$) { ########################################################################## -# Pandora self monitoring process +=head2 C<< pandora_self_monitoring (I<$pa_config>, I<$dbh>) >> + +Pandora self monitoring process + +=cut ########################################################################## + sub pandora_self_monitoring ($$) { my ($pa_config, $dbh) = @_; my $timezone_offset = 0; # PENDING (TODO) !