2011-03-14 Raul Mateos <raulolfpandora@gmail.com>

* lib/PandoraFMS/Config.pm, lib/PandoraFMS/Core.pm,
        lib/PandoraFMS/DataServer.pm, lib/PandoraFMS/DB.pm,
        lib/PandoraFMS/Tools.pm, lib/PandoraFMS/WMIServer.pm: Cleared code and
        updated year.

git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4089 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
raulmateos 2011-03-14 10:39:31 +00:00
parent 709668cf41
commit 797a655a8c
7 changed files with 369 additions and 361 deletions

View File

@ -1,3 +1,10 @@
2011-03-14 Raúl Mateos <raulolfpandora@gmail.com>
* lib/PandoraFMS/Config.pm, lib/PandoraFMS/Core.pm,
lib/PandoraFMS/DataServer.pm, lib/PandoraFMS/DB.pm,
lib/PandoraFMS/Tools.pm, lib/PandoraFMS/WMIServer.pm: Cleared code and
updated year.
2011-03-09 Sancho Lerena <slerena@artica.es> 2011-03-09 Sancho Lerena <slerena@artica.es>
* conf/pandora_server.conf * conf/pandora_server.conf

View File

@ -3,7 +3,7 @@ package PandoraFMS::Config;
# Configuration Package # Configuration Package
# Pandora FMS. the Flexible Monitoring System. http://www.pandorafms.org # Pandora FMS. the Flexible Monitoring System. http://www.pandorafms.org
########################################################################## ##########################################################################
# Copyright (c) 2005-2010 Artica Soluciones Tecnologicas S.L # Copyright (c) 2005-2011 Artica Soluciones Tecnologicas S.L
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License # modify it under the terms of the GNU Lesser General Public License

View File

@ -3,7 +3,7 @@ package PandoraFMS::Core;
# Core Pandora FMS functions. # Core Pandora FMS functions.
# Pandora FMS. the Flexible Monitoring System. http://www.pandorafms.org # Pandora FMS. the Flexible Monitoring System. http://www.pandorafms.org
########################################################################## ##########################################################################
# Copyright (c) 2005-2010 Artica Soluciones Tecnologicas S.L # Copyright (c) 2005-2011 Artica Soluciones Tecnologicas S.L
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License # modify it under the terms of the GNU Lesser General Public License
@ -973,8 +973,8 @@ sub pandora_update_agent ($$$$$$$;$$$$$$) {
if (defined($parent_agent_id)) { if (defined($parent_agent_id)) {
# Update the table tagente with all the new data and set the new parent # Update the table tagente with all the new data and set the new parent
db_do ($dbh, 'UPDATE tagente SET intervalo = ?, agent_version = ?, ultimo_contacto_remoto = ?, ultimo_contacto = ?, os_version = ?, db_do ($dbh, 'UPDATE tagente SET intervalo = ?, agent_version = ?, ultimo_contacto_remoto = ?, ultimo_contacto = ?, os_version = ?,
timezone_offset = ?, id_parent = ? WHERE id_agente = ?', $agent_interval, $agent_version, $agent_timestamp, $timestamp, $os_version, timezone_offset = ?, id_parent = ? WHERE id_agente = ?', $agent_interval, $agent_version, $agent_timestamp,
$timezone_offset, $parent_agent_id, $agent_id); $timestamp, $os_version, $timezone_offset, $parent_agent_id, $agent_id);
} }
else { else {
# Update the table tagente with all the new data # Update the table tagente with all the new data
@ -1929,7 +1929,8 @@ sub pandora_server_statistics ($$) {
$server->{"modules_total"} = get_db_value ($dbh,"SELECT count(tagente_estado.id_agente_modulo) FROM tserver, tagente_estado, tagente_modulo, tagente WHERE tagente.disabled=0 AND tagente_modulo.id_agente = tagente.id_agente AND tagente_modulo.disabled = 0 AND tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo AND tagente_estado.running_by = tserver.id_server AND tserver.server_type = ".$server->{"server_type"}); $server->{"modules_total"} = get_db_value ($dbh,"SELECT count(tagente_estado.id_agente_modulo) FROM tserver, tagente_estado, tagente_modulo, tagente WHERE tagente.disabled=0 AND tagente_modulo.id_agente = tagente.id_agente AND tagente_modulo.disabled = 0 AND tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo AND tagente_estado.running_by = tserver.id_server AND tserver.server_type = ".$server->{"server_type"});
if ($server->{"server_type"} != 0){ if ($server->{"server_type"} != 0){
$lag_row = get_db_single_row ($dbh, "SELECT COUNT(tagente_modulo.id_agente_modulo) AS module_lag, AVG(UNIX_TIMESTAMP() - utimestamp - current_interval) AS lag FROM tagente_estado, tagente_modulo $lag_row = get_db_single_row ($dbh, "SELECT COUNT(tagente_modulo.id_agente_modulo) AS module_lag, AVG(UNIX_TIMESTAMP() - utimestamp - current_interval) AS lag
FROM tagente_estado, tagente_modulo
WHERE utimestamp > 0 WHERE utimestamp > 0
AND tagente_modulo.disabled = 0 AND tagente_modulo.disabled = 0
AND tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo AND tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo
@ -1939,7 +1940,8 @@ sub pandora_server_statistics ($$) {
AND (UNIX_TIMESTAMP() - utimestamp) > current_interval"); AND (UNIX_TIMESTAMP() - utimestamp) > current_interval");
} else { } else {
# Local/Dataserver server LAG calculation: # Local/Dataserver server LAG calculation:
$lag_row = get_db_single_row ($dbh, "SELECT COUNT(tagente_modulo.id_agente_modulo) AS module_lag, AVG(UNIX_TIMESTAMP() - utimestamp - current_interval) AS lag FROM tagente_estado, tagente_modulo $lag_row = get_db_single_row ($dbh, "SELECT COUNT(tagente_modulo.id_agente_modulo) AS module_lag, AVG(UNIX_TIMESTAMP() - utimestamp - current_interval) AS lag
FROM tagente_estado, tagente_modulo
WHERE utimestamp > 0 WHERE utimestamp > 0
AND tagente_modulo.disabled = 0 AND tagente_modulo.disabled = 0
AND tagente_modulo.id_tipo_modulo < 5 AND tagente_modulo.id_tipo_modulo < 5
@ -2101,7 +2103,7 @@ sub pandora_self_monitoring ($$) {
$agents_unknown = 0 if (!defined($agents_unknown)); $agents_unknown = 0 if (!defined($agents_unknown));
} }
my $queued_modules = get_db_value ($dbh, "SELECT SUM(queued_modules) FROM tserver WHERE name = '".$pa_config->{"servername"}."'"); my $queued_modules = get_db_value ($dbh, "SELECT SUM(queued_modules) FROM tserver WHERE name = '".$pa_config->{"servername"}."'");
if (!defined($queued_modules)){ if (!defined($queued_modules)){
$queued_modules = 0; $queued_modules = 0;
@ -2216,6 +2218,6 @@ L<DBI>, L<XML::Simple>, L<HTML::Entities>, L<Time::Local>, L<POSIX>, L<PandoraFM
=head1 COPYRIGHT =head1 COPYRIGHT
Copyright (c) 2005-2010 Artica Soluciones Tecnologicas S.L Copyright (c) 2005-2011 Artica Soluciones Tecnologicas S.L
=cut =cut

View File

@ -3,7 +3,7 @@ package PandoraFMS::DB;
# Database Package # Database Package
# Pandora FMS. the Flexible Monitoring System. http://www.pandorafms.org # Pandora FMS. the Flexible Monitoring System. http://www.pandorafms.org
########################################################################## ##########################################################################
# Copyright (c) 2005-2010 Artica Soluciones Tecnologicas S.L # Copyright (c) 2005-2011 Artica Soluciones Tecnologicas S.L
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License # modify it under the terms of the GNU Lesser General Public License

View File

@ -3,7 +3,7 @@ package PandoraFMS::DataServer;
# Pandora FMS Data Server. # Pandora FMS Data Server.
# Pandora FMS. the Flexible Monitoring System. http://www.pandorafms.org # Pandora FMS. the Flexible Monitoring System. http://www.pandorafms.org
########################################################################## ##########################################################################
# Copyright (c) 2005-2010 Artica Soluciones Tecnologicas S.L # Copyright (c) 2005-2011 Artica Soluciones Tecnologicas S.L
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License # modify it under the terms of the GNU Lesser General Public License

View File

@ -3,7 +3,7 @@ package PandoraFMS::Tools;
# Tools Package # Tools Package
# Pandora FMS. the Flexible Monitoring System. http://www.pandorafms.org # Pandora FMS. the Flexible Monitoring System. http://www.pandorafms.org
########################################################################## ##########################################################################
# Copyright (c) 2005-2009 Artica Soluciones Tecnologicas S.L # Copyright (c) 2005-2011 Artica Soluciones Tecnologicas S.L
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License # modify it under the terms of the GNU Lesser General Public License
@ -827,7 +827,6 @@ Ping the given host. Returns the average round-trip time.
sub pandora_ping_latency ($$) { sub pandora_ping_latency ($$) {
my ($pa_config, $host) = @_; my ($pa_config, $host) = @_;
my $output = 0; my $output = 0;
# See codes on http://perldoc.perl.org/perlport.html#PLATFORMS # See codes on http://perldoc.perl.org/perlport.html#PLATFORMS

View File

@ -3,7 +3,7 @@ package PandoraFMS::WMIServer;
# Pandora FMS WMI Server. # Pandora FMS WMI Server.
# Pandora FMS. the Flexible Monitoring System. http://www.pandorafms.org # Pandora FMS. the Flexible Monitoring System. http://www.pandorafms.org
########################################################################## ##########################################################################
# Copyright (c) 2005-2009 Artica Soluciones Tecnologicas S.L # Copyright (c) 2005-2011 Artica Soluciones Tecnologicas S.L
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License # modify it under the terms of the GNU Lesser General Public License