From 626a9d17c6b6c4ccfa657139c3e3d7d739e1c6ad Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Fri, 1 Oct 2021 12:35:26 +0200 Subject: [PATCH] timeout for server API conn test at start --- pandora_server/bin/pandora_server | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora_server/bin/pandora_server b/pandora_server/bin/pandora_server index 6b1c36c158..8faa6e2eaa 100755 --- a/pandora_server/bin/pandora_server +++ b/pandora_server/bin/pandora_server @@ -738,7 +738,9 @@ sub main() { # Testing API url my $curl_execution = "'".$Config{'console_api_url'}."?op=get&op2=test&apipass=".$Config{"console_api_pass"}."&user=".$Config{"console_user"}."&pass=".$Config{"console_pass"}."'"; - my $exe_testing_api = `curl $curl_execution 2>/dev/null`; + # More than 30 secs is highly unrecommendated + my $command = $Config{'plugin_exec'}.' 30 curl '.$curl_execution.' 2>/dev/null'; + my $exe_testing_api = `$command`; my @res_testing_api = split(',', $exe_testing_api); if ( $res_testing_api[0] ne 'OK' ) { logger(\%Config, "Warning! The server does not have access to the API, this can trigger problems in the generation of reports and graphs.", 1);