diff --git a/pandora_agents/unix/ChangeLog b/pandora_agents/unix/ChangeLog index 7a525405b1..52bea7a1f2 100644 --- a/pandora_agents/unix/ChangeLog +++ b/pandora_agents/unix/ChangeLog @@ -1,3 +1,8 @@ +2011-07-14 Ramon Novoa + + * pandora_agent: Set additional module configuration parameters + from the XML. + 2011-04-13 Dario Rodriguez * HP-UX/pandora_agent.conf: Fixed a wrong path for command swapinfo. diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index c55d7e909d..df605acf98 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -311,6 +311,12 @@ sub parse_conf_modules($) { 'max' => undef, 'min' => undef, 'post_process' => undef, + 'min_critical' => undef, + 'max_critical' => undef, + 'min_warning' => undef, + 'max_warning' => undef, + 'disabled' => undef, + 'min_ff_event' => undef, 'save' => '', 'conditions' => [], 'cron' => '', @@ -414,6 +420,24 @@ sub parse_conf_modules($) { # Collection } elsif ($line =~ /^\s*file_collection\s+(.+)$/) { my $collection = $1; + # Min critical + } elsif ($line =~ /^\s*module_min_critical\s+(.*)\s*$/) { + $module->{'min_critical'} = $1; + # Max critical + } elsif ($line =~ /^\s*module_max_critical\s+(.*)\s*$/) { + $module->{'max_critical'} = $1; + # Min warning + } elsif ($line =~ /^\s*module_min_warning\s+(.*)\s*$/) { + $module->{'min_warning'} = $1; + # Max warning + } elsif ($line =~ /^\s*module_max_warning\s+(.*)\s*$/) { + $module->{'max_warning'} = $1; + # Disabled + } elsif ($line =~ /^\s*module_disabled\s+(.*)\s*$/) { + $module->{'disabled'} = $1; + # Min ff event + } elsif ($line =~ /^\s*module_min_ff_event\s+(.*)\s*$/) { + $module->{'min_ff_event'} = $1; } } return; @@ -1419,6 +1443,24 @@ sub write_module_xml ($@) { # Post process $Xml .= " " . $module->{'post_process'} . "\n" if (defined ($module->{'post_process'})); + # Min critical + $Xml .= " " . $module->{'min_critical'} . "\n" if (defined ($module->{'min_critical'})); + + # Max critical + $Xml .= " " . $module->{'max_critical'} . "\n" if (defined ($module->{'max_critical'})); + + # Min warning + $Xml .= " " . $module->{'min_warning'} . "\n" if (defined ($module->{'min_warning'})); + + # Max warning + $Xml .= " " . $module->{'max_warning'} . "\n" if (defined ($module->{'max_warning'})); + + # Disabled + $Xml .= " " . $module->{'disabled'} . "\n" if (defined ($module->{'disabled'})); + + # Min ff event + $Xml .= " " . $module->{'min_ff_event'} . "\n" if (defined ($module->{'min_ff_event'})); + # Data list if ($#data > 0) { $Xml .= " \n";