Check server remote config every keepalive time and not server_threshold

This commit is contained in:
fermin831 2015-10-14 19:10:16 +02:00
parent fecceb401f
commit 6a709d20ef

View File

@ -580,6 +580,8 @@ sub main() {
# Main loop
my $time_ref = time ();
my $test_remote_interval = ($Config{'keepalive'}/$Config{'server_threshold'});
my $test_remote = 0;
while ($RUN == 1) {
eval {
@ -628,6 +630,7 @@ sub main() {
close (OLDOUT);
}
if ($test_remote >= $test_remote_interval) {
if ($Config{'remote_config'} == 1 && enterprise_hook ('pandora_remote_config_server', [\%Config])) {
# Generate 'restarting' events
@ -635,10 +638,15 @@ sub main() {
$server->restartEvent ($@);
}
logger (\%Config, 'Pandora FMS Server restarting (' . $@ . ') in 10 seconds.', 1);
logger (\%Config, 'Pandora FMS Server restarting (' . $@ . ') in 5 seconds.', 1);
pandora_load_config (\%Config);
pandora_restart (5);
}
$test_remote = 0;
}
else {
$test_remote++;
}
threads->yield;
sleep ($Config{'server_threshold'});