mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-25 23:05:30 +02:00
2010-07-27 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/Core.pm: Make sure delete_pending is set to 0 when selecting keepalive modules. * lib/PandoraFMS/DataServer.pm: Do not read more than max_queue_files files. Suppressed some warnings. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3069 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
0e52a05cf5
commit
a94fde2603
@ -1,3 +1,11 @@
|
|||||||
|
2010-07-27 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
|
* lib/PandoraFMS/Core.pm: Make sure delete_pending is set to 0
|
||||||
|
when selecting keepalive modules.
|
||||||
|
|
||||||
|
* lib/PandoraFMS/DataServer.pm: Do not read more than max_queue_files
|
||||||
|
files. Suppressed some warnings.
|
||||||
|
|
||||||
2010-07-27 Ramon Novoa <rnovoa@artica.es>
|
2010-07-27 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
* lib/PandoraFMS/Core.pm: Removed a misplaced parenthesis.
|
* lib/PandoraFMS/Core.pm: Removed a misplaced parenthesis.
|
||||||
|
@ -999,7 +999,7 @@ sub pandora_module_keep_alive ($$$$$) {
|
|||||||
logger($pa_config, "Updating keep_alive module for agent '" . $agent_name . "'.", 10);
|
logger($pa_config, "Updating keep_alive module for agent '" . $agent_name . "'.", 10);
|
||||||
|
|
||||||
# Update keepalive module
|
# Update keepalive module
|
||||||
my $module = get_db_single_row ($dbh, 'SELECT * FROM tagente_modulo WHERE id_agente = ? AND id_tipo_modulo = 100', $id_agent);
|
my $module = get_db_single_row ($dbh, 'SELECT * FROM tagente_modulo WHERE id_agente = ? AND delete_pending = 0 AND id_tipo_modulo = 100', $id_agent);
|
||||||
return unless defined ($module);
|
return unless defined ($module);
|
||||||
|
|
||||||
my %data = ('data' => 1);
|
my %data = ('data' => 1);
|
||||||
|
@ -82,16 +82,30 @@ sub data_producer ($) {
|
|||||||
my $pa_config = $self->getConfig ();
|
my $pa_config = $self->getConfig ();
|
||||||
|
|
||||||
my @tasks;
|
my @tasks;
|
||||||
|
my @files;
|
||||||
|
|
||||||
# Read all files in the incoming directory
|
# Open the incoming directory
|
||||||
opendir (DIR, $pa_config->{'incomingdir'})
|
opendir (DIR, $pa_config->{'incomingdir'})
|
||||||
|| die "[FATAL] Cannot open Incoming data directory at " . $pa_config->{'incomingdir'} . ": $!";
|
|| die "[FATAL] Cannot open Incoming data directory at " . $pa_config->{'incomingdir'} . ": $!";
|
||||||
|
|
||||||
my @files = readdir (DIR);
|
# Do not read more than max_queue_files files
|
||||||
|
my $file_count = 0;
|
||||||
|
while (my $file = readdir (DIR)) {
|
||||||
|
if ($file_count > $pa_config->{"max_queue_files"}) {
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
push (@files, $file);
|
||||||
|
$file_count++;
|
||||||
|
}
|
||||||
closedir(DIR);
|
closedir(DIR);
|
||||||
|
|
||||||
|
# Temporarily disable warnings (some files may have been deleted)
|
||||||
|
{
|
||||||
|
no warnings;
|
||||||
@files = sort { -C $pa_config->{'incomingdir'} . "/$b" <=> -C $pa_config->{'incomingdir'} . "/$a" } (@files);
|
@files = sort { -C $pa_config->{'incomingdir'} . "/$b" <=> -C $pa_config->{'incomingdir'} . "/$a" } (@files);
|
||||||
|
}
|
||||||
|
|
||||||
|
# Queue files
|
||||||
my $queue_count = 0;
|
my $queue_count = 0;
|
||||||
foreach my $file_name (@files) {
|
foreach my $file_name (@files) {
|
||||||
if ($queue_count > $pa_config->{"max_queue_files"}) {
|
if ($queue_count > $pa_config->{"max_queue_files"}) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user