Added new config tokens to make possible the connection to the console api

This commit is contained in:
Alejandro Gallardo Escobar 2015-02-09 17:47:34 +01:00
parent ba1c14ec4f
commit c95401a251
3 changed files with 46 additions and 0 deletions

View File

@ -482,3 +482,17 @@ claim_back_snmp_modules 1
# interval will become normal. Set to 0 to disable.
async_recovery 1
# Console API credentials.
# Required for some features like the module graphs macros.
# console_api_url: Api URL (http://localhost/pandora/include/api.php by default)
console_api_url http://localhost/pandora/include/api.php
# console_api_pass: Api pass
# console_api_pass 1234
# console_user: Console user name (admin by default)
console_user admin
# console_pass: Console password (pandora by default)
console_pass pandora

View File

@ -289,3 +289,17 @@ restart_delay 60
# interval will become normal. Set to 0 to disable.
async_recovery 1
# Console API credentials.
# Required for some features like the module graphs macros.
# console_api_url: Api URL (http://localhost/pandora/include/api.php by default)
console_api_url http://localhost/pandora/include/api.php
# console_api_pass: Api pass
# console_api_pass 1234
# console_user: Console user name (admin by default)
console_user admin
# console_pass: Console password (pandora by default)
console_pass pandora

View File

@ -343,6 +343,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/include/api.php'; # 6.0
$pa_config->{"console_api_pass"} = ''; # 6.0
$pa_config->{"console_user"} = 'admin'; # 6.0
$pa_config->{"console_pass"} = 'pandora'; # 6.0
# -------------------------------------------------------------------------
# This values are not stored in .conf files.
# This values should be stored in database, not in .conf files!
@ -814,6 +820,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);
}
} # end of loop for parameter #
# Set to RDBMS' standard port