Added a token to configure the self monitoring interval.
This commit is contained in:
parent
c3fa2dd561
commit
4fd4118828
|
@ -333,11 +333,10 @@ sub pandora_server_tasks ($) {
|
|||
}
|
||||
|
||||
# Pandora self monitoring
|
||||
if (($counter % 180) == 0) {
|
||||
if (defined($pa_config->{"self_monitoring"})
|
||||
&& $pa_config->{"self_monitoring"} == 1){
|
||||
pandora_self_monitoring ($pa_config, $dbh);
|
||||
}
|
||||
if (defined($pa_config->{"self_monitoring"})
|
||||
&& $pa_config->{"self_monitoring"} == 1
|
||||
&& $counter % $pa_config->{'self_monitoring_interval'} == 0) {
|
||||
pandora_self_monitoring ($pa_config, $dbh);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -338,6 +338,9 @@ restart_delay 60
|
|||
|
||||
self_monitoring 1
|
||||
|
||||
# Self monitoring interval (in seconds).
|
||||
self_monitoring_interval 300
|
||||
|
||||
# Update parent from the agent xml
|
||||
|
||||
#update_parent 1
|
||||
|
|
|
@ -304,6 +304,9 @@ sub pandora_load_config {
|
|||
# Self monitoring
|
||||
$pa_config->{'self_monitoring'} = 0;
|
||||
|
||||
# Self monitoring interval
|
||||
$pa_config->{'self_monitoring_interval'} = 300; # 5.1SP1
|
||||
|
||||
# Process XML data files as a stack
|
||||
$pa_config->{"dataserver_lifo"} = 0; # 5.0
|
||||
|
||||
|
@ -711,6 +714,9 @@ sub pandora_load_config {
|
|||
elsif ($parametro =~ m/^self_monitoring\s+([0-1])/i) {
|
||||
$pa_config->{'self_monitoring'} = clean_blank($1);
|
||||
}
|
||||
elsif ($parametro =~ m/^self_monitoring_interval\s+([0-9]*)/i) {
|
||||
$pa_config->{'self_monitoring_interval'} = clean_blank($1);
|
||||
}
|
||||
elsif ($parametro =~ m/^update_parent\s+([0-1])/i) {
|
||||
$pa_config->{'update_parent'} = clean_blank($1);
|
||||
}
|
||||
|
|
|
@ -4097,7 +4097,7 @@ sub pandora_self_monitoring ($$) {
|
|||
|
||||
my $xml_output = "";
|
||||
|
||||
$xml_output = "<agent_data os_name='Linux' os_version='".$pa_config->{'version'}."' agent_name='".$pa_config->{'servername'}."' interval='".$pa_config->{"stats_interval"}."' timestamp='".$timestamp."' >";
|
||||
$xml_output = "<agent_data os_name='Linux' os_version='".$pa_config->{'version'}."' agent_name='".$pa_config->{'servername'}."' interval='".$pa_config->{"self_monitoring_interval"}."' timestamp='".$timestamp."' >";
|
||||
$xml_output .=" <module>";
|
||||
$xml_output .=" <name>Status</name>";
|
||||
$xml_output .=" <type>generic_proc</type>";
|
||||
|
|
Loading…
Reference in New Issue