From a26115d2f70ba3b7ec7cf53cb08f9ed751b82ed9 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Tue, 15 Dec 2009 17:32:53 +0000 Subject: [PATCH] 2009-12-15 Ramon Novoa * 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 --- pandora_agents/unix/ChangeLog | 4 ++++ pandora_agents/unix/pandora_agent | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) 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;