2012-05-10 Sergio Martin <sergio.martin@artica.es>

* unix/Linux/pandora_agent.conf
	unix/pandora_agent: Added units parameter to the 
	agent and added units to the default modules in
	conf for pending task #3520530



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6290 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2012-05-10 16:27:15 +00:00
parent 3cc649fb39
commit d458a4792c
3 changed files with 19 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2012-05-10 Sergio Martin <sergio.martin@artica.es>
* unix/Linux/pandora_agent.conf
unix/pandora_agent: Added units parameter to the
agent and added units to the default modules in
conf for pending task #3520530
2012-05-08 Dario Rodriguez <dario.rodriguez@artica.es>
* unix/Linux/pandora_agent.conf: Fixed an example module name.

View File

@ -168,6 +168,7 @@ module_min_warning 70
module_max_warning 90
module_min_critical 91
module_max_critical 100
module_unit %
module_end
#Get load average
@ -188,6 +189,7 @@ module_min_warning 500
module_max_warning 600
module_min_critical 100
module_max_critical 499
module_unit MB
module_end
#Count total number of processes
@ -200,6 +202,7 @@ module_min_warning 150
module_max_warning 249
module_min_critical 250
module_max_critical 300
module_unit processes
module_end
# Process information
@ -220,7 +223,7 @@ module_exec last | head -1
module_description Monitor last user loggin
module_end
# Module that get the number or cron file
# Module that get the number of cron file
# This module uses a precondition, if cron is running the
# module will check the folder /etc/cron.d to get the number of files
module_begin
@ -229,6 +232,7 @@ module_type async_string
module_precondition =~ .*cron.* ps aux | grep cron
module_exec ls -l /etc/cron.d | awk 'NR>1 {print $0}' | wc -l
module_description Number of cron task files
module_unit files
module_end

View File

@ -356,6 +356,7 @@ sub parse_conf_modules($) {
'intensive_conditions' => [],
'intensive_match' => 0,
'timestamp' => 0,
'unit' => '',
};
} elsif ($line =~ /^\s*module_name\s+(.+)$/) {
$module->{'name'} = $1;
@ -498,6 +499,9 @@ sub parse_conf_modules($) {
# Min ff event
} elsif ($line =~ /^\s*module_min_ff_event\s+(.*)\s*$/) {
$module->{'min_ff_event'} = $1;
# Unit
} elsif ($line =~ /^\s*module_unit\s+(\S+)\s*$/) {
$module->{'unit'} = $1;
}
}
return;
@ -1580,6 +1584,9 @@ sub write_module_xml ($@) {
# Min ff event
$Xml .= " <min_ff_event>" . $module->{'min_ff_event'} . "</min_ff_event>\n" if (defined ($module->{'min_ff_event'}));
# Unit
$Xml .= " <unit>" . $module->{'unit'} . "</unit>\n" if (defined ($module->{'unit'}));
# Data list
if ($#data > 0) {