Add lost option of API in server config. Tiquet: #2972

This commit is contained in:
m-lopez-f 2016-01-27 15:44:33 +01:00
parent 7627b91c88
commit 5b249e3bae
2 changed files with 29 additions and 0 deletions

View File

@ -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

View File

@ -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);
}