diff --git a/pandora_agents/unix/ChangeLog b/pandora_agents/unix/ChangeLog index 448bc9e4af..9eaf07595c 100644 --- a/pandora_agents/unix/ChangeLog +++ b/pandora_agents/unix/ChangeLog @@ -1,3 +1,7 @@ +2009-12-15 Ramon Novoa + + * pandora_agent: Make modules with a module_interval run the first time. + 2009-12-07 Sancho Lerena * plugins/inventory: Fixed some problems with the plugin (for linux). Added diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 73aa0983bd..d7721da930 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -180,6 +180,11 @@ sub read_config (;$) { $module->{'max'} = $1; } elsif ($line =~ /^\s*module_min\s+(\d+)\s*$/) { $module->{'max'} = $1; + } elsif ($line =~ /^\s*module_interval\s+(\d+)\s*$/) { + $module->{'interval'} = $1; + + # Make the module run the first time + $module->{'counter'} = $1; } elsif ($line =~ /^\s*module_end\s*$/) { next unless ($module->{'name'} ne '') and ($module->{'exec'} ne ''); push (@Modules, $module); @@ -543,7 +548,7 @@ while (1) { # Check module interval next unless (++$module->{'counter'} >= $module->{'interval'}); - +print "INTERVAL: " . $module->{'interval'} . "\n"; # Reset module counter $module->{'counter'} = 0;