2009-12-15 Ramon Novoa <rnovoa@artica.es>

* pandora_agent: Make modules with a module_interval run the first time.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2199 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Ramon Novoa 2009-12-15 17:32:53 +00:00
parent 126d51f874
commit a26115d2f7
2 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2009-12-15 Ramon Novoa <rnovoa@artica.es>
* pandora_agent: Make modules with a module_interval run the first time.
2009-12-07 Sancho Lerena <slerena@artica.es>
* plugins/inventory: Fixed some problems with the plugin (for linux). Added

View File

@ -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;