From f4b555162b8b3604266d7b0b30a2ff64496cc7a1 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Tue, 8 Aug 2023 15:02:31 +0200 Subject: [PATCH 1/6] #11843 First part of discovery deprecate warning change --- .../godmode/wizards/Applications.class.php | 2 +- .../godmode/wizards/Cloud.class.php | 2 +- .../wizards/DiscoveryTaskList.class.php | 27 +++++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/wizards/Applications.class.php b/pandora_console/godmode/wizards/Applications.class.php index 2237fdbe73..5c17a79d1d 100644 --- a/pandora_console/godmode/wizards/Applications.class.php +++ b/pandora_console/godmode/wizards/Applications.class.php @@ -52,7 +52,7 @@ class Applications extends Wizard int $page=0, string $msg='Default message. Not set.', string $icon='images/wizard/applications.png', - string $label='Applications' + string $label='Applications (legacy)' ) { $this->setBreadcrum([]); diff --git a/pandora_console/godmode/wizards/Cloud.class.php b/pandora_console/godmode/wizards/Cloud.class.php index 4664b1a566..1ee331fbca 100644 --- a/pandora_console/godmode/wizards/Cloud.class.php +++ b/pandora_console/godmode/wizards/Cloud.class.php @@ -89,7 +89,7 @@ class Cloud extends Wizard int $page=0, string $msg='Default message. Not set.', string $icon='images/wizard/cloud.png', - string $label='Cloud' + string $label='Cloud (legacy)' ) { $this->setBreadcrum([]); diff --git a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php index 1c7ffe5526..b69459045b 100644 --- a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php +++ b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php @@ -214,6 +214,9 @@ class DiscoveryTaskList extends HTML html_print_action_buttons($this->printForm($form, true)); } + // Warning Message. + $this->getWarningMessage(); + return $ret; } @@ -2022,4 +2025,28 @@ class DiscoveryTaskList extends HTML } + /** + * Generates warning message. + * + * @return void Warning message. + */ + public function getWarningMessage() + { + return ui_print_warning_message( + __( + 'Starting with version 773, the new modular system of discovery 2.0 has been implemented. The current + discovery (1.0) and its defined tasks will continue to function normally until the next LTS version, + in which migration to the new system will be mandatory. + The tasks of the current discovery (1.0) will be marked as legacy although it will not affect their + operation, it will only be a visual indicator to identify and differentiate the tasks of discovery 1.0 + from those of the new version 2.0. + In the intermediate versions between the 773 and the next LTS version, more applications of the new + discovery 2.0 will be added. Both new and those that will come to replace the applications of the + current discovery 1.0. In addition, an automatic migration tool for legacy (1.0) tasks to the new 2.0 + model will be included.' + ) + ); + } + + } From ed9b70725dccb4618b5eba51fd8586ed3f570dcf Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Wed, 9 Aug 2023 14:40:56 +0200 Subject: [PATCH 2/6] #11843 Added word legacy in the discovery. It is added only for version 1.0 of discovery. --- pandora_console/godmode/menu.php | 18 ++++----- .../godmode/wizards/Applications.class.php | 3 ++ .../wizards/DiscoveryTaskList.class.php | 37 ++++++++++--------- .../godmode/wizards/Wizard.main.php | 24 ++++++++++++ 4 files changed, 56 insertions(+), 26 deletions(-) diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index 3f8ade2b1a..5090a8baa1 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -82,12 +82,12 @@ if ((bool) check_acl($config['id_user'], 0, 'AR') === true // Applications. $sub2 = []; if (enterprise_installed() === true) { - $sub2['godmode/servers/discovery&wiz=app&mode=MicrosoftSQLServer']['text'] = __('Microsoft SQL Server'); - $sub2['godmode/servers/discovery&wiz=app&mode=mysql']['text'] = __('Mysql'); - $sub2['godmode/servers/discovery&wiz=app&mode=oracle']['text'] = __('Oracle'); - $sub2['godmode/servers/discovery&wiz=app&mode=vmware']['text'] = __('VMware'); - $sub2['godmode/servers/discovery&wiz=app&mode=SAP']['text'] = __('SAP'); - $sub2['godmode/servers/discovery&wiz=app&mode=DB2']['text'] = __('DB2'); + $sub2['godmode/servers/discovery&wiz=app&mode=MicrosoftSQLServer']['text'] = __('Microsoft SQL Server (legacy)'); + $sub2['godmode/servers/discovery&wiz=app&mode=mysql']['text'] = __('Mysql (legacy)'); + $sub2['godmode/servers/discovery&wiz=app&mode=oracle']['text'] = __('Oracle (legacy)'); + $sub2['godmode/servers/discovery&wiz=app&mode=vmware']['text'] = __('VMware (legacy)'); + $sub2['godmode/servers/discovery&wiz=app&mode=SAP']['text'] = __('SAP (legacy)'); + $sub2['godmode/servers/discovery&wiz=app&mode=DB2']['text'] = __('DB2 (legacy)'); } $extensions = ManageExtensions::getExtensionBySection('app'); @@ -112,9 +112,9 @@ if ((bool) check_acl($config['id_user'], 0, 'AR') === true // Cloud. $sub2 = []; if (enterprise_installed() === true) { - $sub2['godmode/servers/discovery&wiz=cloud&mode=amazonws']['text'] = __('Amazon Web Services'); - $sub2['godmode/servers/discovery&wiz=cloud&mode=azure']['text'] = __('Microsoft Azure'); - $sub2['godmode/servers/discovery&wiz=cloud&mode=gcp']['text'] = __('Google Compute Platform'); + $sub2['godmode/servers/discovery&wiz=cloud&mode=amazonws']['text'] = __('Amazon Web Services (legacy)'); + $sub2['godmode/servers/discovery&wiz=cloud&mode=azure']['text'] = __('Microsoft Azure (legacy)'); + $sub2['godmode/servers/discovery&wiz=cloud&mode=gcp']['text'] = __('Google Compute Platform (legacy)'); } diff --git a/pandora_console/godmode/wizards/Applications.class.php b/pandora_console/godmode/wizards/Applications.class.php index 5c17a79d1d..4c42247b4a 100644 --- a/pandora_console/godmode/wizards/Applications.class.php +++ b/pandora_console/godmode/wizards/Applications.class.php @@ -67,6 +67,9 @@ class Applications extends Wizard 'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=app' ); + // Print Warning Message. + $this->printWarningMessage(); + return $this; } diff --git a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php index b69459045b..36a21ecf71 100644 --- a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php +++ b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php @@ -32,6 +32,8 @@ require_once $config['homedir'].'/include/class/HTML.class.php'; require_once $config['homedir'].'/include/functions_users.php'; require_once $config['homedir'].'/include/functions_reports.php'; require_once $config['homedir'].'/include/functions_cron.php'; +require_once $config['homedir'].'/godmode/wizards/Wizard.main.php'; + enterprise_include_once('include/functions_tasklist.php'); enterprise_include_once('include/functions_cron.php'); @@ -215,7 +217,8 @@ class DiscoveryTaskList extends HTML } // Warning Message. - $this->getWarningMessage(); + $wizar_main = new Wizard(); + $wizar_main->printWarningMessage(); return $ret; } @@ -779,7 +782,7 @@ class DiscoveryTaskList extends HTML 'class' => 'main_menu_icon invert_filter', ] ).'  '; - $data[6] .= __('Cloud.Azure.Compute'); + $data[6] .= __('Cloud.Azure.Compute (legacy)'); break; case DISCOVERY_CLOUD_AWS_EC2: @@ -792,7 +795,7 @@ class DiscoveryTaskList extends HTML 'class' => 'main_menu_icon invert_filter', ] ).'  '; - $data[6] .= __('Cloud.AWS.EC2'); + $data[6] .= __('Cloud.AWS.EC2 (legacy)'); break; case DISCOVERY_CLOUD_AWS_RDS: @@ -805,7 +808,7 @@ class DiscoveryTaskList extends HTML 'class' => 'main_menu_icon invert_filter', ] ).'  '; - $data[6] .= __('Discovery.Cloud.Aws.RDS'); + $data[6] .= __('Discovery.Cloud.Aws.RDS (legacy)'); break; case DISCOVERY_CLOUD_AWS_S3: @@ -818,7 +821,7 @@ class DiscoveryTaskList extends HTML 'class' => 'main_menu_icon invert_filter', ] ).'  '; - $data[6] .= __('Discovery.Cloud.Aws.S3'); + $data[6] .= __('Discovery.Cloud.Aws.S3 (legacy)'); break; case DISCOVERY_APP_MYSQL: @@ -831,7 +834,7 @@ class DiscoveryTaskList extends HTML 'class' => 'main_menu_icon invert_filter', ] ).'  '; - $data[6] .= __('Discovery.App.MySQL'); + $data[6] .= __('Discovery.App.MySQL (legacy)'); break; case DISCOVERY_APP_ORACLE: @@ -844,7 +847,7 @@ class DiscoveryTaskList extends HTML 'class' => 'main_menu_icon invert_filter', ] ).'  '; - $data[6] .= __('Discovery.App.Oracle'); + $data[6] .= __('Discovery.App.Oracle (legacy)'); break; case DISCOVERY_APP_DB2: @@ -857,7 +860,7 @@ class DiscoveryTaskList extends HTML 'class' => 'main_menu_icon invert_filter', ] ).'  '; - $data[6] .= __('Discovery.App.DB2'); + $data[6] .= __('Discovery.App.DB2 (legacy)'); break; case DISCOVERY_DEPLOY_AGENTS: @@ -868,7 +871,7 @@ class DiscoveryTaskList extends HTML true, ['title' => __('Agent deployment')] ).'  '; - $data[6] .= __('Discovery.Agent.Deployment'); + $data[6] .= __('Discovery.Agent.Deployment (legacy)'); break; case DISCOVERY_APP_MICROSOFT_SQL_SERVER: @@ -881,7 +884,7 @@ class DiscoveryTaskList extends HTML 'class' => 'main_menu_icon invert_filter', ] ).'  '; - $data[6] .= __('Discovery.App.Microsoft SQL Server'); + $data[6] .= __('Discovery.App.Microsoft SQL Server (legacy)'); break; case DISCOVERY_EXTENSION: @@ -909,7 +912,7 @@ class DiscoveryTaskList extends HTML 'class' => 'main_menu_icon invert_filter', ] ).'  '; - $data[6] .= __('Discovery.NetScan'); + $data[6] .= __('Discovery.NetScan (legacy)'); } else { // APP or external script recon task. $data[6] = html_print_image( @@ -917,7 +920,7 @@ class DiscoveryTaskList extends HTML true, ['class' => 'main_menu_icon invert_filter'] ).'  '; - $data[6] .= $recon_script_name; + $data[6] .= $recon_script_name.' (legacy)'; } break; } @@ -2025,13 +2028,13 @@ class DiscoveryTaskList extends HTML } - /** + /* * Generates warning message. * * @return void Warning message. - */ - public function getWarningMessage() - { + + public function getWarningMessage() + { return ui_print_warning_message( __( 'Starting with version 773, the new modular system of discovery 2.0 has been implemented. The current @@ -2046,7 +2049,7 @@ class DiscoveryTaskList extends HTML model will be included.' ) ); - } + }*/ } diff --git a/pandora_console/godmode/wizards/Wizard.main.php b/pandora_console/godmode/wizards/Wizard.main.php index 39c81569c4..a286b97fca 100644 --- a/pandora_console/godmode/wizards/Wizard.main.php +++ b/pandora_console/godmode/wizards/Wizard.main.php @@ -522,4 +522,28 @@ class Wizard } + /** + * Generates warning message. + * + * @return void Warning message. + */ + public function printWarningMessage() + { + return ui_print_warning_message( + __( + 'Starting with version 773, the new modular system of discovery 2.0 has been implemented. The current + discovery (1.0) and its defined tasks will continue to function normally until the next LTS version, + in which migration to the new system will be mandatory. + The tasks of the current discovery (1.0) will be marked as legacy although it will not affect their + operation, it will only be a visual indicator to identify and differentiate the tasks of discovery 1.0 + from those of the new version 2.0. + In the intermediate versions between the 773 and the next LTS version, more applications of the new + discovery 2.0 will be added. Both new and those that will come to replace the applications of the + current discovery 1.0. In addition, an automatic migration tool for legacy (1.0) tasks to the new 2.0 + model will be included.' + ) + ); + } + + } From 6cd5fc491b9b8859c0a8efc3a2f87bee1035bf79 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Wed, 9 Aug 2023 15:26:30 +0200 Subject: [PATCH 3/6] #11843 adjusted type for extensions --- .../godmode/wizards/Applications.class.php | 2 +- pandora_console/godmode/wizards/Cloud.class.php | 2 +- .../include/class/ExtensionsDiscovery.class.php | 11 ++++++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/pandora_console/godmode/wizards/Applications.class.php b/pandora_console/godmode/wizards/Applications.class.php index 4c42247b4a..107550c261 100644 --- a/pandora_console/godmode/wizards/Applications.class.php +++ b/pandora_console/godmode/wizards/Applications.class.php @@ -52,7 +52,7 @@ class Applications extends Wizard int $page=0, string $msg='Default message. Not set.', string $icon='images/wizard/applications.png', - string $label='Applications (legacy)' + string $label='Applications' ) { $this->setBreadcrum([]); diff --git a/pandora_console/godmode/wizards/Cloud.class.php b/pandora_console/godmode/wizards/Cloud.class.php index 1ee331fbca..4664b1a566 100644 --- a/pandora_console/godmode/wizards/Cloud.class.php +++ b/pandora_console/godmode/wizards/Cloud.class.php @@ -89,7 +89,7 @@ class Cloud extends Wizard int $page=0, string $msg='Default message. Not set.', string $icon='images/wizard/cloud.png', - string $label='Cloud (legacy)' + string $label='Cloud' ) { $this->setBreadcrum([]); diff --git a/pandora_console/include/class/ExtensionsDiscovery.class.php b/pandora_console/include/class/ExtensionsDiscovery.class.php index da26fb1780..6b3af5f757 100644 --- a/pandora_console/include/class/ExtensionsDiscovery.class.php +++ b/pandora_console/include/class/ExtensionsDiscovery.class.php @@ -210,9 +210,18 @@ class ExtensionsDiscovery extends Wizard $logo = $this->defaultLogo; } + // Get type of task. + $task = db_get_row( + 'trecon_task', + 'id_app', + $extension['id_app'] + ); + + $task_type = (integer) $task['type']; + $extension_name = ($task_type == DISCOVERY_EXTENSION) ? $extension['name'] : $extension['name'].' (legacy)'; $extensions[] = [ 'icon' => $logo, - 'label' => $extension['name'], + 'label' => $extension_name, 'url' => ui_get_full_url( 'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz='.$this->section.'&mode='.$extension['short_name'] ), From 236ad09ad686ad5216b9d2e349eb5c3c3274369e Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Thu, 10 Aug 2023 14:08:31 +0200 Subject: [PATCH 4/6] #11843 Added MR and pandorabd_data --- pandora_console/extras/mr/65.sql | 76 ++++++++++++++++++++++++++++++ pandora_console/pandoradb_data.sql | 76 ++++++++++++++++++++++++++++++ 2 files changed, 152 insertions(+) diff --git a/pandora_console/extras/mr/65.sql b/pandora_console/extras/mr/65.sql index 563d00e82c..6e4290d6e3 100644 --- a/pandora_console/extras/mr/65.sql +++ b/pandora_console/extras/mr/65.sql @@ -115,4 +115,80 @@ SELECT * FROM ( ALTER TABLE tevento DROP COLUMN user_comment; +-- Insert new VMware APP +SET @short_name = 'pandorafms.vmware'; +SET @name = 'VMware'; +SET @section = 'app'; +SET @description = 'Monitor ESXi hosts, datastores and VMs from a specific datacenter'; +SET @version = '1.0'; +INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version); +SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name; + +-- Insert into tdiscovery_apps_scripts +INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_vmware'); +INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec2_', 'bin/vmware_instances'); + +-- Insert into tdiscovery_apps_executions +INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' '_tempfileVMware_' --as_discovery_plugin 1'); + +-- Insert new MySQL APP +SET @short_name = 'pandorafms.mysql'; +SET @name = 'MySQL'; +SET @section = 'app'; +SET @description = 'Monitor MySQL databases'; +SET @version = '1.0'; +INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version); +SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name; + +-- Insert into tdiscovery_apps_scripts +INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_mysql'); + +-- Insert into tdiscovery_apps_executions +INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' --conf '_tempfileConf_' --target_databases '_tempfileTargetDatabases_' --target_agents '_tempfileTargetAgents_' --custom_queries '_tempfileCustomQueries_''); + +-- Insert new MSSQL APP +SET @short_name = 'pandorafms.mssql'; +SET @name = 'Microsoft SQL Server'; +SET @section = 'app'; +SET @description = 'Monitor Microsoft SQL Server databases'; +SET @version = '1.0'; +INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version); +SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name; + +-- Insert into tdiscovery_apps_scripts +INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_mssql'); + +-- Insert into tdiscovery_apps_executions +INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' --conf '_tempfileConf_' --target_databases '_tempfileTargetDatabases_' --target_agents '_tempfileTargetAgents_' --custom_queries '_tempfileCustomQueries_''); + +-- Insert new Oracle APP +SET @short_name = 'pandorafms.oracle'; +SET @name = 'Oracle'; +SET @section = 'app'; +SET @description = 'Monitor Oracle databases'; +SET @version = '1.0'; +INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version); +SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name; + +-- Insert into tdiscovery_apps_scripts +INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_oracle'); + +-- Insert into tdiscovery_apps_executions +INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' --conf '_tempfileConf_' --target_databases '_tempfileTargetDatabases_' --target_agents '_tempfileTargetAgents_' --custom_queries '_tempfileCustomQueries_''); + +-- Insert new DB2 APP +SET @short_name = 'pandorafms.db2'; +SET @name = 'DB2'; +SET @section = 'app'; +SET @description = 'Monitor DB2 databases'; +SET @version = '1.0'; +INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version); +SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name; + +-- Insert into tdiscovery_apps_scripts +INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_db2'); + +-- Insert into tdiscovery_apps_executions +INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' --conf '_tempfileConf_' --target_databases '_tempfileTargetDatabases_' --target_agents '_tempfileTargetAgents_' --custom_queries '_tempfileCustomQueries_''); + COMMIT; diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index ebf38a35f7..f5e52ae45e 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -2636,3 +2636,79 @@ INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES ( INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Zoom on data graphs','Do you know that Pandora FMS allows you to zoom in on a part of the graph. With that you will expand the information of the graph. If you are looking at a graph for a month and you zoom in, you will be able to see the data for that interval. If you use a graph with full resolution data (we call them TIP graphs) you will be able to see the detail of each piece of data, even if your graph has thousands of samples.','',1); SELECT @last_id := LAST_INSERT_ID(); INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'zoom_en_graficas.png','images/tips/'); + +-- Insert new VMware APP +SET @short_name = 'pandorafms.vmware'; +SET @name = 'VMware'; +SET @section = 'app'; +SET @description = 'Monitor ESXi hosts, datastores and VMs from a specific datacenter'; +SET @version = '1.0'; +INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version); +SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name; + +-- Insert into tdiscovery_apps_scripts +INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_vmware'); +INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec2_', 'bin/vmware_instances'); + +-- Insert into tdiscovery_apps_executions +INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' '_tempfileVMware_' --as_discovery_plugin 1'); + +-- Insert new MySQL APP +SET @short_name = 'pandorafms.mysql'; +SET @name = 'MySQL'; +SET @section = 'app'; +SET @description = 'Monitor MySQL databases'; +SET @version = '1.0'; +INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version); +SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name; + +-- Insert into tdiscovery_apps_scripts +INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_mysql'); + +-- Insert into tdiscovery_apps_executions +INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' --conf '_tempfileConf_' --target_databases '_tempfileTargetDatabases_' --target_agents '_tempfileTargetAgents_' --custom_queries '_tempfileCustomQueries_''); + +-- Insert new MSSQL APP +SET @short_name = 'pandorafms.mssql'; +SET @name = 'Microsoft SQL Server'; +SET @section = 'app'; +SET @description = 'Monitor Microsoft SQL Server databases'; +SET @version = '1.0'; +INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version); +SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name; + +-- Insert into tdiscovery_apps_scripts +INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_mssql'); + +-- Insert into tdiscovery_apps_executions +INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' --conf '_tempfileConf_' --target_databases '_tempfileTargetDatabases_' --target_agents '_tempfileTargetAgents_' --custom_queries '_tempfileCustomQueries_''); + +-- Insert new Oracle APP +SET @short_name = 'pandorafms.oracle'; +SET @name = 'Oracle'; +SET @section = 'app'; +SET @description = 'Monitor Oracle databases'; +SET @version = '1.0'; +INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version); +SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name; + +-- Insert into tdiscovery_apps_scripts +INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_oracle'); + +-- Insert into tdiscovery_apps_executions +INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' --conf '_tempfileConf_' --target_databases '_tempfileTargetDatabases_' --target_agents '_tempfileTargetAgents_' --custom_queries '_tempfileCustomQueries_''); + +-- Insert new DB2 APP +SET @short_name = 'pandorafms.db2'; +SET @name = 'DB2'; +SET @section = 'app'; +SET @description = 'Monitor DB2 databases'; +SET @version = '1.0'; +INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version); +SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name; + +-- Insert into tdiscovery_apps_scripts +INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_db2'); + +-- Insert into tdiscovery_apps_executions +INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' --conf '_tempfileConf_' --target_databases '_tempfileTargetDatabases_' --target_agents '_tempfileTargetAgents_' --custom_queries '_tempfileCustomQueries_''); \ No newline at end of file From 88dbd5a2060ba0f8e080b5df945d9c83c24ced40 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Fri, 11 Aug 2023 12:33:29 +0200 Subject: [PATCH 5/6] #11843 fixed legacy for apps --- .../include/class/ExtensionsDiscovery.class.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/pandora_console/include/class/ExtensionsDiscovery.class.php b/pandora_console/include/class/ExtensionsDiscovery.class.php index 6b3af5f757..da26fb1780 100644 --- a/pandora_console/include/class/ExtensionsDiscovery.class.php +++ b/pandora_console/include/class/ExtensionsDiscovery.class.php @@ -210,18 +210,9 @@ class ExtensionsDiscovery extends Wizard $logo = $this->defaultLogo; } - // Get type of task. - $task = db_get_row( - 'trecon_task', - 'id_app', - $extension['id_app'] - ); - - $task_type = (integer) $task['type']; - $extension_name = ($task_type == DISCOVERY_EXTENSION) ? $extension['name'] : $extension['name'].' (legacy)'; $extensions[] = [ 'icon' => $logo, - 'label' => $extension_name, + 'label' => $extension['name'], 'url' => ui_get_full_url( 'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz='.$this->section.'&mode='.$extension['short_name'] ), From f275cde74577d5bff54ffed8769f95a51c718e67 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Mon, 14 Aug 2023 11:50:06 +0200 Subject: [PATCH 6/6] #11843 Warning added message in cloud view --- pandora_console/godmode/wizards/Cloud.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandora_console/godmode/wizards/Cloud.class.php b/pandora_console/godmode/wizards/Cloud.class.php index 4664b1a566..4c5074cd3c 100644 --- a/pandora_console/godmode/wizards/Cloud.class.php +++ b/pandora_console/godmode/wizards/Cloud.class.php @@ -220,6 +220,9 @@ class Cloud extends Wizard echo '
*'.__('All company names used here are for identification purposes only. Use of these names, logos, and brands does not imply endorsement.').'
'; } + // Print Warning Message. + $this->printWarningMessage(); + return $result; }