2009-04-20 Ramon Novoa <rnovoa@artica.es>

* lib/PandoraFMS/Core.pm: Re-enabled detection of duplicate data
          within a 48 hour interval.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1634 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Ramon Novoa 2009-04-20 16:53:37 +00:00
parent 7b1ef8c44f
commit 75773f72da
2 changed files with 11 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2009-04-20 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/Core.pm: Re-enabled detection of duplicate data
within a 48 hour interval.
2009-04-20 Sancho Lerena <slerena@artica.es> 2009-04-20 Sancho Lerena <slerena@artica.es>
* pandora_server_installer: Added --no-tentacle switch, added more * pandora_server_installer: Added --no-tentacle switch, added more

View File

@ -19,10 +19,11 @@ package PandoraFMS::Core;
use strict; use strict;
use warnings; use warnings;
use DBI; use DBI;
use XML::Simple; use XML::Simple;
use HTML::Entities; use HTML::Entities;
use Time::Local;
use POSIX qw(strftime); use POSIX qw(strftime);
use PandoraFMS::DB; use PandoraFMS::DB;
@ -545,8 +546,9 @@ sub pandora_process_module ($$$$$$$$) {
} }
# Do we have to save module data? # Do we have to save module data?
#my $save = ($module->{'history_data'} == 1 && ($agent_status->{'datos'} ne $data || $agent_status->{'last_try'} < (time() - 86400))) ? 1 : 0; return unless ($agent_status->{'last_try'} =~ /(\d+)\-(\d+)\-(\d+) +(\d+):(\d+):(\d+)/);
my $save = ($module->{'history_data'} == 1 && $agent_status->{'datos'} ne $data) ? 1 : 0; my $last_try = ($1 == 0) ? 0 : timelocal($6, $5, $4, $3, $2 - 1, $1 - 1900);
my $save = ($module->{'history_data'} == 1 && ($agent_status->{'datos'} ne $data || $last_try < (time() - 86400))) ? 1 : 0;
db_do ($dbh, 'UPDATE tagente_estado SET datos = ?, estado = ?, last_status = ?, status_changes = ?, utimestamp = ?, timestamp = ?, db_do ($dbh, 'UPDATE tagente_estado SET datos = ?, estado = ?, last_status = ?, status_changes = ?, utimestamp = ?, timestamp = ?,
id_agente = ?, current_interval = ?, running_by = ?, last_execution_try = ?, last_try = ? id_agente = ?, current_interval = ?, running_by = ?, last_execution_try = ?, last_try = ?
@ -716,7 +718,7 @@ sub pandora_create_module ($$$$$$$$) {
my $module_id = db_insert($dbh, 'INSERT INTO tagente_modulo (`id_agente`, `id_tipo_modulo`, `nombre`, `max`, `min`, `descripcion`, `module_interval`, `id_modulo`) my $module_id = db_insert($dbh, 'INSERT INTO tagente_modulo (`id_agente`, `id_tipo_modulo`, `nombre`, `max`, `min`, `descripcion`, `module_interval`, `id_modulo`)
VALUES (?, ?, ?, ?, ?, ?, ?, 1)', $agent_id, $module_type_id, $module_name, $max, $min, $description, $interval); VALUES (?, ?, ?, ?, ?, ?, ?, 1)', $agent_id, $module_type_id, $module_name, $max, $min, $description, $interval);
db_do ($dbh, 'INSERT INTO tagente_estado (`id_agente_modulo`) VALUES (?)', $module_id); db_do ($dbh, 'INSERT INTO tagente_estado (`id_agente_modulo`, `last_try`) VALUES (?, \'0000-00-00 00:00:00\')', $module_id);
return $module_id; return $module_id;
} }