From 7e5a082e226f2e6840df8fdb866a301bbf3c87ae Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Mon, 14 Jun 2021 19:29:24 +0200 Subject: [PATCH 1/2] pandora_ha enterprise components fixed --- pandora_server/lib/PandoraFMS/Tools.pm | 5 +++-- pandora_server/util/pandora_ha.pl | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index 8f994092aa..d4109d7d54 100755 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -915,8 +915,9 @@ sub float_equal { # Tries to load the PandoraEnterprise module. Must be called once before # enterprise_hook (). ################################################################################ -sub enterprise_load ($) { +sub enterprise_load ($;$) { my $pa_config = shift; + my $muted = shift; # Check dependencies @@ -944,7 +945,7 @@ sub enterprise_load ($) { } # Initialize the enterprise module. - PandoraFMS::Enterprise::init($pa_config); + PandoraFMS::Enterprise::init($pa_config, $muted); return 1; } diff --git a/pandora_server/util/pandora_ha.pl b/pandora_server/util/pandora_ha.pl index aa093ce8cc..ffe4dea01f 100755 --- a/pandora_server/util/pandora_ha.pl +++ b/pandora_server/util/pandora_ha.pl @@ -296,6 +296,21 @@ sub ha_main($) { while ($Running) { eval { + eval { + local $SIG{__DIE__}; + # Load enterprise components. + enterprise_load($conf, 1); + + # Register Enterprise logger + enterprise_hook('pandoraha_logger', [\&log_message]); + log_message($conf, 'LOG', 'Enterprise capabilities loaded'); + + }; + if ($@) { + # No enterprise capabilities. + log_message($conf, 'LOG', 'No enterprise capabilities'); + } + # Start the Pandora FMS server if needed. log_message($conf, 'LOG', 'Checking the pandora_server service.'); From 14495ebdc31adcbf111e756d55a178e619b6d657 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 15 Jun 2021 11:06:46 +0200 Subject: [PATCH 2/2] Current package updates --- pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 4 ++-- pandora_console/pandoradb_data.sql | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 1335550ef7..21657b5ebb 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -1438,13 +1438,13 @@ ALTER TABLE `ttag` MODIFY COLUMN `name` text NOT NULL default ''; INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30'); -INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 44); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 47); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png'); UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager'; DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise'; -INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', 752); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package', 755); INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp'); UPDATE `tconfig` SET `value` = 'mini_severity,evento,id_agente,estado,timestamp' WHERE `token` LIKE 'event_fields'; DELETE FROM `tconfig` WHERE `token` LIKE 'integria_api_password'; diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 26032195a8..9e5fefa497 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -109,10 +109,10 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_report_front_logo', 'images/pandora_logo_white.jpg'), ('custom_report_front_header', ''), ('custom_report_front_footer', ''), -('MR', 46), +('MR', 47), ('identification_reminder', 1), ('identification_reminder_timestamp', 0), -('current_package_enterprise', 754), +('current_package', 755), ('post_process_custom_values', '{"0.00000038580247":"Seconds to months","0.00000165343915":"Seconds to weeks","0.00001157407407":"Seconds to days","0.01666666666667":"Seconds to minutes","0.00000000093132":"Bytes to Gigabytes","0.00000095367432":"Bytes to Megabytes","0.00097656250000":"Bytes to Kilobytes","0.00000001653439":"Timeticks to weeks","0.00000011574074":"Timeticks to days"}'), ('custom_docs_logo', 'default_docs.png'), ('custom_support_logo', 'default_support.png'),