diff --git a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php index 88506f4a02..59a9fab84a 100644 --- a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php +++ b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php @@ -629,6 +629,16 @@ class DiscoveryTaskList extends HTML $data[6] .= __('Discovery.App.Oracle'); break; + case DISCOVERY_APP_DB2: + // Discovery Applications DB2. + $data[6] = html_print_image( + 'images/network.png', + true, + ['title' => __('Discovery Applications DB2')] + ).'  '; + $data[6] .= __('Discovery.App.DB2'); + break; + case DISCOVERY_DEPLOY_AGENTS: // Internal deployment task. $no_operations = true; @@ -722,6 +732,8 @@ class DiscoveryTaskList extends HTML if ($task['disabled'] != 2 && $task['utimestamp'] > 0 && $task['type'] != DISCOVERY_APP_MYSQL && $task['type'] != DISCOVERY_APP_ORACLE + && $task['type'] != DISCOVERY_APP_DB2 + && $task['type'] != DISCOVERY_APP_SAP && $task['type'] != DISCOVERY_CLOUD_AWS_RDS ) { if (check_acl($config['id_user'], 0, 'MR')) { @@ -879,6 +891,9 @@ class DiscoveryTaskList extends HTML case DISCOVERY_APP_ORACLE: return 'wiz=app&mode=oracle&page=0'; + case DISCOVERY_APP_DB2: + return 'wiz=app&mode=DB2&page=0'; + case DISCOVERY_CLOUD_AWS: case DISCOVERY_CLOUD_AWS_EC2: return 'wiz=cloud&mode=amazonws&ki='.$task['auth_strings'].'&page=1'; diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php index 25674080d0..c2f6a5d74c 100644 --- a/pandora_console/include/constants.php +++ b/pandora_console/include/constants.php @@ -601,6 +601,7 @@ define('DISCOVERY_CLOUD_AWS_RDS', 7); define('DISCOVERY_CLOUD_AZURE_COMPUTE', 8); define('DISCOVERY_DEPLOY_AGENTS', 9); define('DISCOVERY_APP_SAP', 10); +define('DISCOVERY_APP_DB2', 11); // Force task build tmp results. diff --git a/pandora_server/lib/PandoraFMS/Recon/Base.pm b/pandora_server/lib/PandoraFMS/Recon/Base.pm index 2e54650f7c..1f6e13f2e6 100644 --- a/pandora_server/lib/PandoraFMS/Recon/Base.pm +++ b/pandora_server/lib/PandoraFMS/Recon/Base.pm @@ -40,6 +40,7 @@ use constant { DISCOVERY_CLOUD_AZURE_COMPUTE => 8, DISCOVERY_DEPLOY_AGENTS => 9, DISCOVERY_APP_SAP => 10, + DISCOVERY_APP_DB2 => 11, DISCOVERY_REVIEW => 0, DISCOVERY_STANDARD => 1, DISCOVERY_RESULTS => 2, @@ -1661,6 +1662,9 @@ sub database_scan($$$) { # Skip database scan in Oracle tasks next if defined($self->{'type'}) && $self->{'type'} == DISCOVERY_APP_ORACLE; + # Skip database scan in DB2 tasks + next if defined($self->{'type'}) && $self->{'type'} == DISCOVERY_APP_DB2; + my $__data = $obj->scan_databases(); if (ref($__data) eq "ARRAY") { @@ -1705,6 +1709,8 @@ sub app_scan($) { $type = 'MySQL'; } elsif ($self->{'task_data'}->{'type'} == DISCOVERY_APP_ORACLE) { $type = 'Oracle'; + } elsif ($self->{'task_data'}->{'type'} == DISCOVERY_APP_DB2) { + $type = 'DB2'; } elsif ($self->{'task_data'}->{'type'} == DISCOVERY_APP_SAP) { $type = 'SAP'; } else { @@ -1787,7 +1793,9 @@ sub app_scan($) { # Scan connected obj. if ( $self->{'task_data'}->{'type'} == DISCOVERY_APP_MYSQL - || $self->{'task_data'}->{'type'} == DISCOVERY_APP_ORACLE) { + || $self->{'task_data'}->{'type'} == DISCOVERY_APP_ORACLE + || $self->{'task_data'}->{'type'} == DISCOVERY_APP_DB2 + ) { # Database. $results = $self->database_scan($type, $obj, $global_percent, \@targets); @@ -1894,6 +1902,7 @@ sub scan($) { if (defined($self->{'task_data'})) { if ( $self->{'task_data'}->{'type'} == DISCOVERY_APP_MYSQL || $self->{'task_data'}->{'type'} == DISCOVERY_APP_ORACLE + || $self->{'task_data'}->{'type'} == DISCOVERY_APP_DB2 || $self->{'task_data'}->{'type'} == DISCOVERY_APP_SAP) { # Application scan. $self->call('message', "Scanning application ...", 6);