mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
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
|
# Pandora self monitoring
|
||||||
if (($counter % 180) == 0) {
|
if (defined($pa_config->{"self_monitoring"})
|
||||||
if (defined($pa_config->{"self_monitoring"})
|
&& $pa_config->{"self_monitoring"} == 1
|
||||||
&& $pa_config->{"self_monitoring"} == 1){
|
&& $counter % $pa_config->{'self_monitoring_interval'} == 0) {
|
||||||
pandora_self_monitoring ($pa_config, $dbh);
|
pandora_self_monitoring ($pa_config, $dbh);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -338,6 +338,9 @@ restart_delay 60
|
|||||||
|
|
||||||
self_monitoring 1
|
self_monitoring 1
|
||||||
|
|
||||||
|
# Self monitoring interval (in seconds).
|
||||||
|
self_monitoring_interval 300
|
||||||
|
|
||||||
# Update parent from the agent xml
|
# Update parent from the agent xml
|
||||||
|
|
||||||
#update_parent 1
|
#update_parent 1
|
||||||
|
@ -304,6 +304,9 @@ sub pandora_load_config {
|
|||||||
# Self monitoring
|
# Self monitoring
|
||||||
$pa_config->{'self_monitoring'} = 0;
|
$pa_config->{'self_monitoring'} = 0;
|
||||||
|
|
||||||
|
# Self monitoring interval
|
||||||
|
$pa_config->{'self_monitoring_interval'} = 300; # 5.1SP1
|
||||||
|
|
||||||
# Process XML data files as a stack
|
# Process XML data files as a stack
|
||||||
$pa_config->{"dataserver_lifo"} = 0; # 5.0
|
$pa_config->{"dataserver_lifo"} = 0; # 5.0
|
||||||
|
|
||||||
@ -711,6 +714,9 @@ sub pandora_load_config {
|
|||||||
elsif ($parametro =~ m/^self_monitoring\s+([0-1])/i) {
|
elsif ($parametro =~ m/^self_monitoring\s+([0-1])/i) {
|
||||||
$pa_config->{'self_monitoring'} = clean_blank($1);
|
$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) {
|
elsif ($parametro =~ m/^update_parent\s+([0-1])/i) {
|
||||||
$pa_config->{'update_parent'} = clean_blank($1);
|
$pa_config->{'update_parent'} = clean_blank($1);
|
||||||
}
|
}
|
||||||
|
@ -4097,7 +4097,7 @@ sub pandora_self_monitoring ($$) {
|
|||||||
|
|
||||||
my $xml_output = "";
|
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 .=" <module>";
|
||||||
$xml_output .=" <name>Status</name>";
|
$xml_output .=" <name>Status</name>";
|
||||||
$xml_output .=" <type>generic_proc</type>";
|
$xml_output .=" <type>generic_proc</type>";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user