Merge branch 'ent-5337-Error-en-consulta-de-BD-historica-con-password-cifrado' into 'develop'

fixed history db connection with encrypted passwords

See merge request artica/pandorafms!3111
This commit is contained in:
Alejandro Fraguas 2020-03-20 12:28:48 +01:00
commit 61f8065bfc
1 changed files with 3 additions and 1 deletions

View File

@ -29,6 +29,7 @@ use Time::HiRes qw(usleep);
# Default lib dir for RPM and DEB packages
use lib '/usr/lib/perl5';
use PandoraFMS::Core;
use PandoraFMS::Tools;
use PandoraFMS::Config;
use PandoraFMS::DB;
@ -1079,7 +1080,8 @@ my $history_dbh = undef;
is_metaconsole(\%conf);
if ($conf{'_history_db_enabled'} eq '1') {
eval {
$history_dbh = db_connect ($conf{'dbengine'}, $conf{'_history_db_name'}, $conf{'_history_db_host'}, $conf{'_history_db_port'}, $conf{'_history_db_user'}, $conf{'_history_db_pass'});
$conf{'encryption_key'} = enterprise_hook('pandora_get_encryption_key', [\%conf, $conf{'encryption_passphrase'}]);
$history_dbh = db_connect ($conf{'dbengine'}, $conf{'_history_db_name'}, $conf{'_history_db_host'}, $conf{'_history_db_port'}, $conf{'_history_db_user'}, pandora_output_password(\%conf, $conf{'_history_db_pass'}));
};
if ($@) {
if (is_offline(\%conf)) {