From 5b249e3bae19168f6120dde77ec7d7e2b45d6e74 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Wed, 27 Jan 2016 15:44:33 +0100 Subject: [PATCH] Add lost option of API in server config. Tiquet: #2972 --- pandora_server/conf/pandora_server.conf.new | 11 +++++++++++ pandora_server/lib/PandoraFMS/Config.pm | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/pandora_server/conf/pandora_server.conf.new b/pandora_server/conf/pandora_server.conf.new index aaab797d24..feefedfd01 100644 --- a/pandora_server/conf/pandora_server.conf.new +++ b/pandora_server/conf/pandora_server.conf.new @@ -483,3 +483,14 @@ async_recovery 1 # Time interval (as a multiple of the module interval) before a module becomes unknown. Twice the module's interval by default. #unknown_interval 2 +# console_api_url: Api URL (http://localhost/pandora_console/include/api.php by default) +console_api_url http://localhost/pandora_console/include/api.php + +# console_api_pass: Api pass +console_api_pass pandora + +# console_user: Console user name (admin by default) +console_user admin + +# console_pass: Console password (pandora by default) +console_pass pandora \ No newline at end of file diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 55dee31dd5..a27acd1b60 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -344,6 +344,12 @@ sub pandora_load_config { # Auto-recovery of asynchronous modules. $pa_config->{"async_recovery"} = 1; # 5.1SP1 + # Console API connection + $pa_config->{"console_api_url"} = 'http://localhost/pandora_console/include/api.php'; # 5.1 SP4 + $pa_config->{"console_api_pass"} = ''; # 5.1 SP4 + $pa_config->{"console_user"} = 'admin'; # 5.1 SP4 + $pa_config->{"console_pass"} = 'pandora'; # 5.1 SP4 + # Unknown interval (as a multiple of the module's interval) $pa_config->{"unknown_interval"} = 2; # > 5.1SP2 @@ -821,6 +827,18 @@ sub pandora_load_config { elsif ($parametro =~ m/^async_recovery\s+([0-1])/i) { $pa_config->{'async_recovery'}= safe_input($1); } + elsif ($parametro =~ m/^console_api_url\s(.*)/i) { + $pa_config->{'console_api_url'}= safe_input($1); + } + elsif ($parametro =~ m/^console_api_pass\s(.*)/i) { + $pa_config->{'console_api_pass'}= safe_input($1); + } + elsif ($parametro =~ m/^console_user\s(.*)/i) { + $pa_config->{'console_user'}= safe_input($1); + } + elsif ($parametro =~ m/^console_pass\s(.*)/i) { + $pa_config->{'console_pass'}= safe_input($1); + } elsif ($parametro =~ m/^unknown_interval\s([0-9]*)/i) { # > 5.1SP2 $pa_config->{'unknown_interval'}= safe_input($1); }