From 50dd166cb36a62be9e94880ff7cf03d2e7b8c36f Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Mon, 5 Oct 2020 11:48:06 +0200 Subject: [PATCH 1/4] Testing --- pandora_server/bin/pandora_server | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora_server/bin/pandora_server b/pandora_server/bin/pandora_server index 2537061f14..88fae0d294 100755 --- a/pandora_server/bin/pandora_server +++ b/pandora_server/bin/pandora_server @@ -22,6 +22,7 @@ use warnings; use POSIX qw(strftime); use threads; use Digest::MD5 qw(md5_hex); +use Data::Dumper; # Default lib dir for RPM and DEB packages use lib '/usr/lib/perl5'; @@ -712,6 +713,7 @@ sub main() { 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`; my @res_testing_api = split(',', $exe_testing_api); + logger(\%Config, Dumper(@res_testing_api), 1); 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); pandora_event (\%Config, "Server does not have access to the API", 0, 0, 0, 0, 0, 'system', 0, $DBH); From e8e20b933c4fffe129b8c004a388f1f2651b9898 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Mon, 5 Oct 2020 12:53:49 +0200 Subject: [PATCH 2/4] Testing --- pandora_server/bin/pandora_server | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_server/bin/pandora_server b/pandora_server/bin/pandora_server index 88fae0d294..36ff5124e7 100755 --- a/pandora_server/bin/pandora_server +++ b/pandora_server/bin/pandora_server @@ -714,6 +714,7 @@ sub main() { my $exe_testing_api = `curl $curl_execution 2>/dev/null`; my @res_testing_api = split(',', $exe_testing_api); logger(\%Config, Dumper(@res_testing_api), 1); + logger(\%Config, $curl_execution, 1); 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); pandora_event (\%Config, "Server does not have access to the API", 0, 0, 0, 0, 0, 'system', 0, $DBH); From 0da066954bd7f2e6b68a9fc2adc13be589ac4bd4 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Mon, 5 Oct 2020 15:12:18 +0200 Subject: [PATCH 3/4] Modified localhost for 127.0.0.1 for ACL control --- pandora_server/bin/pandora_server | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pandora_server/bin/pandora_server b/pandora_server/bin/pandora_server index 36ff5124e7..11422df6fb 100755 --- a/pandora_server/bin/pandora_server +++ b/pandora_server/bin/pandora_server @@ -591,7 +591,7 @@ sub main() { my $include_api = 'include/api.php'; # If public_url is empty in database if ( $console_api_url eq '' ) { - $Config{"console_api_url"} = 'http://localhost/pandora_console/' . $include_api; + $Config{"console_api_url"} = 'http://127.0.0.1/pandora_console/' . $include_api; logger(\%Config, "Assuming default path for API url: " . $Config{"console_api_url"}, 3); } else { $Config{"console_api_url"} = $console_api_url . $include_api; @@ -713,8 +713,7 @@ sub main() { 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`; my @res_testing_api = split(',', $exe_testing_api); - logger(\%Config, Dumper(@res_testing_api), 1); - logger(\%Config, $curl_execution, 1); + 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); pandora_event (\%Config, "Server does not have access to the API", 0, 0, 0, 0, 0, 'system', 0, $DBH); From 6459c6aa73a1ff6713a53fca28f046b68a9bfd82 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Mon, 5 Oct 2020 15:15:10 +0200 Subject: [PATCH 4/4] Update the correct file --- pandora_server/bin/pandora_server | 2 -- 1 file changed, 2 deletions(-) diff --git a/pandora_server/bin/pandora_server b/pandora_server/bin/pandora_server index 11422df6fb..812bf1e57b 100755 --- a/pandora_server/bin/pandora_server +++ b/pandora_server/bin/pandora_server @@ -22,7 +22,6 @@ use warnings; use POSIX qw(strftime); use threads; use Digest::MD5 qw(md5_hex); -use Data::Dumper; # Default lib dir for RPM and DEB packages use lib '/usr/lib/perl5'; @@ -713,7 +712,6 @@ sub main() { 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`; 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); pandora_event (\%Config, "Server does not have access to the API", 0, 0, 0, 0, 0, 'system', 0, $DBH);