Discovery and Promotion of a Resource Using the Command Line

OCI Command Line Interface (CLI) can be used to discover Stack Monitoring resources. You can use these CLI commands to create the following resources:

Prerequisites

  1. Make sure the user who is performing the discovery has all required IAM privileges. See Getting Started (with Stack Monitoring)
  2. Install the Management Agent. See Install Management Agents
  3. Set up the OCI command line interface. See Setting up the Configuration File in Working with the Command Line Interface.
  4. Execute Grants required for DB discovery. See MOS Note: 2857604.1.
  5. Execute Grants required if performing of E-Business Suite discovery. See E-Business Suite Database Monitoring Requirements for Stack Monitoring.
Note

When customizing an example JSON file to meet the requirements of your environment, only update the values enclosed within angle brackets (< >).

All credentials should be in base65 encoded format. Other values can be left as is.

Promoting Host Resources

Prerequisites

The agent monitoring the OCI Compute Instance or on-premises hosts must have completed the necessary prerequisites. This includes enabling the Management Agent and Stack Monitoring Plug-in. For more information see Getting Started.

Promotion Command

The following is the OCI CLI command syntax to promote an local hosts and OCI Compute Instance.

oci stack-monitoring discovery-job create --compartment-id "<Compartment_OCID>" --from-json file://<JSON_INPUT_FILE>

The following is an example JSON payload to promote an OCI resource.

{
    "discoveryType": "ADD",
    "discoveryClient": "host-discovery",
    "compartmentId": "<Compartment_OCID>",
    "discoveryDetails": {
      "agentId": "<Agent_OCID>",
      "resourceType": "HOST",
      "resourceName": "<FQDN of hostname>",
      "properties": {
        "propertiesMap": {}
      }
    }
}

For more information regarding input parameters, see JSON Input Parameters

Discovering Apache Tomcat via CLI

Apache Tomcat can be also discovered using the CLI. One of the following JSON files can be used depending on whether JMX authorization is enabled or not.

If JMX authorization is disabled:

{
  "discoveryType": "ADD",
  "discoveryClient": "APPMGMT",
  "compartmentId": "<Compartment_OCID>",
  "discoveryDetails": {
    "agentId": "<Agent_OCID>",
    "resourceType": "APACHE_TOMCAT",
    "resourceName": "<RESOURCE_NAME>",
    "properties": {
      "propertiesMap": {
        "hostname": "<HOSTNAME>",
        "jmx_port": "<JMX_PORT>"
      }
    },
    "tags": {
      "map": {}
    }
  }
}

If JMX authorization is enabled:

{
  "discoveryType": "ADD",
  "discoveryClient": "APPMGMT",
  "compartmentId": "<Compartment_OCID>",
  "discoveryDetails": {
    "agentId": "<Agent_OCID>",
    "resourceType": "APACHE_TOMCAT",
    "resourceName": "<RESOURCE_NAME>",
    "properties": {
      "propertiesMap": {
        "hostname": "<HOSTNAME>",
        "jmx_port": "<JMX_PORT>"
      }
    },
    "credentials": {
      "items": [
        {
          "properties": {
            "propertiesMap": {
              "Username": "<BASE64_ENCODED_USERNAME>",
              "Password": "<BASE64_ENCODED_PASSWORD>"
            }
          },
          "credentialName": "Sk1YQ3JlZHM=",
          "credentialType": "Sk1YQ3JlZHM="
        }
      ]
    },
    "tags": {
      "map": {}
    }
  }
}
Sample command using a JSON file

The following is the OCI CLI command syntax to discover an Apache Tomcat resource.

oci stack-monitoring discovery-job create --compartment-id "<COMPARTMENT_ID>" --from-json file://<JSON_INPUT_FILE>

The following table explains each field in the JSON file. For the JSON payload, keep all other parameter values except the ones described in the table.

Input Field Description Notes
resourceName Name of the Apache Tomcat resource. Use the name to identify your resource in a human friendly way.
agentId The OCID of the on-premise management agent monitoring the resource. Agent ID can be found under Observability & Management, then Agents. This must be the "on-premises" version of the agent (Not OCA plugin).
compartmentId Compartment OCID where the Apache Tomcat resource should be created. Compartment OCID is located under Identity & Security, then Compartments. Identify your compartment and copy the OCID.
hostname Host on which the Apache Tomcat is installed. Hostname can be a fully qualified domain name, ip address or a "localhost" in case this will be a local monitoring.
jmx_port The port used for JMX monitoring. JMX port configured with com.sun.management.jmxremote.port Apache Tomcat property.
Password JMX monitoring password. Base64 encoded JMX monitoring password. Credentials object is optional - required only if authorization is enabled.
Username JMX monitoring username. Base64 encoded JMX monitoring username. Credentials object is optional - required only if authorization is enabled.

Checking the Status of the Promotion Job

Once the command has been executed, the job's status and logs can be viewed within Stack Monitoring under the Resource Discovery page. From the Resource Discovery page, search for the submitted job with a Resource Name matching the name of the Apache Tomcat, a Resource Type of Apache Tomcat, and with a job type of Add. Once the Job Status is Succeeded, click the name of the Apache Tomcat under Resource Name to navigate to the resource’s homepage.

Discovering Microsoft SQL Server via CLI

Microsoft SQL Server can be also discovered using the CLI.

The following is the OCI CLI command syntax to discover a Microsoft SQL Server.

oci stack-monitoring discovery-job create --compartment-id "<COMPARTMENT_ID>" --from-json file://<JSON_INPUT_FILE>

The following is an example JSON payload to promote an OCI resource.

{
  "discoveryType" : "ADD",
  "discoveryClient" : "appmgmt",
  "compartmentId" : "ocid1.compartment.oc1..aaaaaaaanub6bfxvbnhksrq635teb5kpi4bexu7tula27rk7mu5iyhxsfs7q",
  "discoveryDetails" : {
    "agentId" : "ocid1.managementagent.oc1.eu-frankfurt-1.amaaaaaajs23oqqa7dwl3ufqmpp6rlwl3jfpcognwo7qefmddmaa5nqdch6q",
    "resourceType" : "SQL_SERVER_SYSTEM",
    "resourceName" : "test_SQL_SERVER_SYSTEM_fra",
    "properties" : {
      "propertiesMap" : {
        "hostname" : "inframonwin2.subnet1rg2phxsu.emdevinfraphx1.oraclevcn.com",
        "port" : "1433"
      }
    },
    "credentials" : {
      "items" : [ {
        "credentialName" : "U1FMQ3JlZHM=",
        "credentialType" : "REJDcmVkcw==",
        "properties" : {
          "propertiesMap" : {
            "DBUserName" : "U0E=",
            "DBPassword" : "V2VsY29tZTE7MTIz",
            "DBRole" : "ZHVtbXk="
          }
        }
      } ]
    }
  }
}

Discovering PeopleSoft via CLI

See the section on PeopleSoft discovery for information on using the CLI to discover PeopleSoft resources.

Discovering Elasticsearch JSON File

This is an example of the JSON used to discover Elastic Search along Peoplesoft via CLI.

{
  "discoveryType": "ADD",
  "discoveryClient": "DISCOVERY_UI",
  "compartmentId": "<compartment Id>",
  "discoveryDetails": {
      "agentId": "<agent Id>",
      "resourceType": "ORACLE_PSFT",
      "resourceName": "<Name of the resource to show in homepage>",
      "properties": {
          "propertiesMap": {
              "peoplesoft_db_host": "<Host where PSFT database is>",
              "peoplesoft_db_port": "<PSFT database port>",
              "peoplesoft_db_service_name": "<PSFT database service name>",
              "discovery_type": "database_based",
              "discover_elastic_search": "true",
              "database_protocol": "<tcp or tcps>"
          }
      },
      "credentials": {
          "items": [
              {
                  "properties": {
                      "propertiesMap": {
                          "DBUserName": "<base64 encoded database username>",
                          "DBPassword": "<base64 encoded database password>",
                          "DBRole": "<base64 encoded database role>"
                      }
                  },
                  "credentialName": "U1FMQ3JlZHM=",
                  "credentialType": "REJDcmVkcw=="
              },
              {
                  "properties": {
                      "propertiesMap": {
                          "Username": "<base64 encoded AppServer username>",
                          "Password": "<base64 encoded AppServer password>"
                      }
                  },
                  "credentialName": "Sk1YQXBwU2VydmVy",
                  "credentialType": "Sk1YQ3JlZHM="
              },
              {
                  "properties": {
                      "propertiesMap": {
                          "Username": "<base64 encoded Process Scheduler username>",
                          "Password": "<base64 encoded Process Scheduler password>"
                      }
                  },
                  "credentialName": "Sk1YU2NoZWR1bGVy",
                  "credentialType": "Sk1YQ3JlZHM="
              },
              {
                  "properties": {
                      "propertiesMap": {
                          "Username": "<base64 encoded JMX username>",
                          "Password": "<base64 encoded JMX password>"
                      }
                  },
                  "credentialName": "Sk1YQ3JlZHM=",
                  "credentialType": "Sk1YQ3JlZHM="
              },
              {
                  "properties": {
                      "propertiesMap": {
                          "Username": "<base64 encoded REST username>",
                          "Password": "<base64 encoded REST password>",
                          "TrustStorePath": "<base64 encoded truststore location path>",
                          "TrustStoreType": "<base64 encoded truststore type>"
                      }
                  },
                  "credentialName": "UmVzdENyZWRz",
                  "credentialType": "SFRUUFNDcmVkcw=="
              }
          ]
      },
      "tags": {
          "map": {}
      }
  },
  "freeformTags": {},
  "definedTags": {}
}

Command

oci stack-monitoring discovery-job create -c "ocid1.compartment.oc1..aaaaaaaanub6bfxvbnhksrq635teb5kpi4bexu7tula27rk7mu5iyhxsfs7q" --from-json file:///path/to/file

Refreshing Elasticsearch JSON File

This is an example of the JSON used to discover Elastic Search along Peoplesoft via CLI during a REFRESH operation.

{
  "discoveryType": "ADD",
  "discoveryClient": "DISCOVERY_UI",
  "compartmentId": "<compartment Id>",
  "discoveryDetails": {
      "agentId": "<agent Id>",
      "resourceType": "ORACLE_PSFT",
      "resourceName": "<Name of the resource to show in homepage>",
      "properties": {
          "propertiesMap": {
              "peoplesoft_db_host": "<Host where PSFT database is>",
              "peoplesoft_db_port": "<PSFT database port>",
              "peoplesoft_db_service_name": "<PSFT database service name>",
              "discovery_type": "database_based",
              "discover_elastic_search": "true",
              "database_protocol": "<tcp or tcps>"
          }
      },
      "credentials": {
          "items": [
              {
                  "properties": {
                      "propertiesMap": {
                          "DBUserName": "<base64 encoded database username>",
                          "DBPassword": "<base64 encoded database password>",
                          "DBRole": "<base64 encoded database role>"
                      }
                  },
                  "credentialName": "U1FMQ3JlZHM=",
                  "credentialType": "REJDcmVkcw=="
              },
              {
                  "properties": {
                      "propertiesMap": {
                          "Username": "<base64 encoded AppServer username>",
                          "Password": "<base64 encoded AppServer password>"
                      }
                  },
                  "credentialName": "Sk1YQXBwU2VydmVy",
                  "credentialType": "Sk1YQ3JlZHM="
              },
              {
                  "properties": {
                      "propertiesMap": {
                          "Username": "<base64 encoded Process Scheduler username>",
                          "Password": "<base64 encoded Process Scheduler password>"
                      }
                  },
                  "credentialName": "Sk1YU2NoZWR1bGVy",
                  "credentialType": "Sk1YQ3JlZHM="
              },
              {
                  "properties": {
                      "propertiesMap": {
                          "Username": "<base64 encoded JMX username>",
                          "Password": "<base64 encoded JMX password>"
                      }
                  },
                  "credentialName": "Sk1YQ3JlZHM=",
                  "credentialType": "Sk1YQ3JlZHM="
              },
              {
                  "properties": {
                      "propertiesMap": {
                          "Username": "<base64 encoded REST username>",
                          "Password": "<base64 encoded REST password>",
                          "TrustStorePath": "<base64 encoded truststore location path>",
                          "TrustStoreType": "<base64 encoded truststore type>"
                      }
                  },
                  "credentialName": "UmVzdENyZWRz",
                  "credentialType": "SFRUUFNDcmVkcw=="
              }
          ]
      },
      "tags": {
          "map": {}
      }
  },
  "freeformTags": {},
  "definedTags": {}
}

Command

oci stack-monitoring discovery-job create -c "ocid1.compartment.oc1..aaaaaaaanub6bfxvbnhksrq635teb5kpi4bexu7tula27rk7mu5iyhxsfs7q" --from-json file:///path/to/file

Discovering an Oracle Database

Note

Before discovering a PDB, you must first discover the CDB. The following discovery examples discover the CDB or non multi-tenant Oracle Databases.

Note

  • DB System including its components (Listener, ASM, etc) is discovered as part of an Oracle Database discovery.
  • DB System discovery & monitoring is supported only in LINUX environments.

Use the following OCI CLI command syntax to discover an Oracle DB System:

oci stack-monitoring discovery-job create --compartment-id "<Compartment_ID>" --from-json file://<JSON_INPUT_FILE>

For single node Oracle Database discovery, remove the following lines from the respective JSON file:

"additional_agent_1":"<Additional_Agent1_OCID>",
"additional_agent_2":"<Additional_Agent2_OCID>",

Entire DB system discovery using tcp with ASM and additional agents installed on each cluster node.

Note

Additional agents can be added as needed.
{
  "discoveryType": "ADD",
  "discoveryClient": "APPMGMT",
  "compartmentId": "<Compartment_OCID>",
  "discoveryDetails": {
    "agentId": "<Agent_OCID>",
    "resourceType": "ORACLE_DATABASE",
    "resourceName": "<Resource name to display in Stackmonitoring UI>",
    "properties": {
      "propertiesMap": {
            "additional_agent_1":"<Additional_Agent1_OCID>",
            "additional_agent_2":"<Additional_Agent2_OCID>",
            "database_port": "1521",
            "database_host_name":"<DB HOSTNAME OR IP>",
            "database_service_name":"<CDB SERVICE NAME>",
            "asm_host":"<ASM HOSTNAME>",
            "asm_service_name":"+ASM",
            "is_asm_discovery":"true",
            "asm_port":"1521"
      }
    },
    "credentials": {
      "items": [
        {
          "credentialName" : "U1FMQ3JlZHM=",
          "credentialType" : "REJDcmVkcw==",
          "properties": {
            "propertiesMap": {
              "DBUserName": "<Database user who has the necessary privileges on the underlying V$ views in base64 format>",
              "DBPassword": "<Database user password in base 64 encoded format>",
              "DBRole":"<Database user role in base64 encoded encoded format>"
            }
          }
        },{
          "credentialName" : "QVNNUGFzc3dvcmRJblZhdWx0",
          "credentialType" : "U1NMX1NFQ1JFVF9JRA==",
          "properties": {
            "propertiesMap": {
              "ASMUserName": "<ASM user name in base64 encoded format>
              "PasswordSecretId": "<Encoded ASM user secret ocid in BASE64 encoded format>",
              "ASMRole":"<ASM user role in base64 encoded format>"
            }
          }
        }
      ]
    }
   }
}

Entire DB system discovery using tcps with ASM and additional agents installed on each cluster node.

Note

Additional agents can be added as needed.
{
  "discoveryType": "ADD",
  "discoveryClient": "APPMGMT",
  "compartmentId": "<Compartment_OCID>",
  "discoveryDetails": {
    "agentId": "<Agent_OCID>",
    "resourceType": "ORACLE_DATABASE",
    "resourceName": "<Resource name to display in Stackmonitoring UI>",
    "properties": {
      "propertiesMap": {
            "additional_agent_1":"<Additional_Agent1_OCID>",
            "additional_agent_2":"<Additional_Agent2_OCID>",
            "database_port": "TCPS Port",
            "database_protocol": "tcps",            
            "database_host_name":"<DB HOSTNAME OR IP>",
            "database_service_name":"<CDB SERVICE NAME>",
            "ssl_secret_id":  "<ocid of a SiV, Secret in Vault, that contains the tcps details>",            
            "asm_host":"<ASM HOSTNAME>",
            "asm_service_name":"+ASM",
            "is_asm_discovery":"true",
            "asm_port":"1521"
      }
    },
    "credentials": {
      "items": [
        {
          "credentialName" : "U1FMQ3JlZHM=",
          "credentialType" : "REJUQ1BTQ3JlZHM=",
          "properties": {
            "propertiesMap": {
              "DBUserName": "<Database user who has the necessary privileges on the underlying V$ views in base64 format>",
              "DBPassword": "<Database user password in base 64 encoded format>",
              "DBRole":"<Database user role in base64 encoded encoded format>"
            }
          }
        },{
          "credentialName" : "QVNNUGFzc3dvcmRJblZhdWx0",
          "credentialType" : "U1NMX1NFQ1JFVF9JRA==",
          "properties": {
            "propertiesMap": {
              "ASMUserName": "<ASM user name in base64 encoded format>",
              "PasswordSecretId": "<Encoded ASM user secret ocid in BASE64 encoded format>",
              "ASMRole":"<ASM user role in base64 encoded format>"
            }
          }
        }
      ]
    }
   }
}

Entire DB system discovery using tcp without ASM and additional agents installed on each cluster node.

Note

Additional agents can be added as needed.
{
   "discoveryType":"ADD",
   "discoveryClient":"APPMGMT",
   "compartmentId":"<Compartment_OCID>",
   "discoveryDetails":{
      "agentId":"<Agent_OCID>",
      "resourceType":"ORACLE_DATABASE",
      "resourceName":"<Resource name to display in Stackmonitoring UI>",
      "properties":{
         "propertiesMap":{
            "additional_agent_1":"<Additional_Agent1_OCID>",
            "additional_agent_2":"<Additional_Agent2_OCID>",
            "database_port":"1521",
            "database_host_name":"<DB HOSTNAME OR IP>",
            "database_service_name":"<CDB SERVICE NAME>"
         }
      },
      "credentials":{
         "items":[
            {
               "credentialName":"U1FMQ3JlZHM=",
               "credentialType":"REJDcmVkcw==",
               "properties":{
                  "propertiesMap":{
                     "DBUserName":"<Database user who has the necessary privileges on the underlying V$ views in base64 format>",
                     "DBPassword":"<Database user password in base 64 encoded format>",
                     "DBRole":"<Database user role in base64 encoded encoded format>"
                  }
               }
            }
         ]
      }
   }
}

Entire DB system discovery using tcps without ASM and additional agents installed on each cluster node.

Note

Additional agents can be added as needed.
{
   "discoveryType":"ADD",
   "discoveryClient":"APPMGMT",
   "compartmentId":"<Compartment_OCID>",
   "discoveryDetails":{
      "agentId":"<Agent_OCID>",
      "resourceType":"ORACLE_DATABASE",
      "resourceName":"<Resource name to display in Stackmonitoring UI>",
      "properties":{
         "propertiesMap":{
            "additional_agent_1":"<Additional_Agent1_OCID>",
            "additional_agent_2":"<Additional_Agent2_OCID>",
            "database_port":"TCPS Port",
            "database_protocol":"tcps",
            "database_host_name":"<DB HOSTNAME OR IP>",
            "database_service_name":"<CDB SERVICE NAME>",
            "ssl_secret_id":  "<ocid of a SiV, Secret in Vault, that contains the tcps details>"
         }
      },
      "credentials":{
         "items":[
            {
               "credentialName":"U1FMQ3JlZHM=",
               "credentialType":"REJUQ1BTQ3JlZHM=",
               "properties":{
                  "propertiesMap":{
                     "DBUserName":"<Database user who has the necessary privileges on the underlying V$ views in base64 format>",
                     "DBPassword":"<Database user password in base 64 encoded format>",
                     "DBRole":"<Database user role in base64 encoded encoded format>"
                  }
               }
            }
         ]
      }
   }
}

CLI Discovery Input

CLI Input Variable Description
<Additional_Agent1_OCID> 1st additional node in cluster
<Additional_Agent2_OCID> (etc) 2nd additional node in cluster (continue for each additional node in the cluster)
Agent_OCID Agent of the initial discovery OCID
ASM_Hostname This should match the hostname provided as DB_Hostname_or_IP
ASM_Port The typical value is 1521, provide the port to match that of your listener
ASM_Role Base64 encoded ASM user's role
ASM_Service_Name The service name of the ASM instnace. This is typically +ASM
ASM_User_Name Base64 encoded credentials
Password_Secret_Id Encoded ASM user password secret in BASE64 encoded format
Compartment_OCID The compartment OCID where the Oracle Database System will be monitored
database_port The Oracle Database
Database_Service_Name The service name of the CDB or non multi-tenant database
DB_Hostname_or_IP The fully qualified domain name or IP address where <AGENT_OCID> above resides.
DB_Role Base64 encoded database user's role
DB_User_Name / DB_Password Base64 encoded credentials
Resource_Name This is the name of the resource in Stack Monitoring
ssl_secret_id OCID of a SiV that contains the tcps. For more information, see Create an OCI Secret.

Discovering PDB

PDB Discovery JSON file

{
 "discoveryType": "ADD",
 "discoveryClient": "APPMGMT",
 "compartmentId": "<Compartment_OCID>",
 "discoveryDetails": {
 "agentId" : "<Agent_OCID>",
  "resourceType": "OCI_ORACLE_PDB",
  "resourceName": "<TARGET NAME TO DISPLAY STACKMON UI>",
  "properties": {
   "propertiesMap": {
      "database_port": "<1521 OR DB LISTENER PORT>",
      "database_host_name":"<DB HOSTNAME OR IP>",
      "database_service_name":"<PDB SERVICE NAME>",
      "externalContainerDatabaseId":"<STACKMON RESOURCE CDB OCID>"
   }
  },
  "credentials": {
   "items": [
    {
     "credentialName" : "U1FMQ3JlZHM=",
     "credentialType" : "REJDcmVkcw==",
     "properties": {
      "propertiesMap": {
       "DBUserName": "<PDB Database user who has the necessary privileges on the underlying V$ views in base64 encoded format>",
       "DBPassword": "<PDB Database user password in base64 encoded format>",
       "DBRole":"<Database user role in base64 encoded format>"
      }
     }
    }
   ]
  }
 }
}

PDB with TCPS Discovery JSON file

{
    "discoveryType": "ADD",
    "discoveryClient": "APPMGMT",
    "compartmentId": "<Compartment_OCID>",
    "discoveryDetails": {
        "agentId": "<Agent_OCID>",
        "resourceType": "OCI_ORACLE_PDB",
        "resourceName": "<TARGET NAME TO DISPLAY STACKMONITORING UI>",
        "properties": {
            "propertiesMap": {
                "externalContainerDatabaseId": "<STACKMON RESOURCE CDB OCID>",
                "database_host_name": "<PDB DB HOSTNAME OR IP>",
                "database_port": "<DB TCPS LISTENER PORT/2484>",
                "database_service_name": "<PDB SERVICE NAME>",
                "database_protocol": "tcps",
                "ssl_secret_id":  "<ocid of a SiV, Secret in Vault, that contains the tcps details>"
            }
        },
        "credentials": {
            "items": [
                {
                    "properties": {
                        "propertiesMap": {
                            "DBUserName": "<PDB Database user who has the necessary privileges on the underlying V$ views in base64 encoded format>",
                            "DBPassword": "<PDB Database user password in base64 encoded format>",
                            "DBRole": "<Database user role in base64 encoded format>"
                        }
                    },
                    "credentialName": "U1FMQ3JlZHM=",
                    "credentialType": "REJUQ1BTQ3JlZHM="
                }
            ]
        }
    }
}

PDB JSON Input Parameters

JSON Parameter Description Notes Editable or not
discoveryType ADD . NO
discoveryClient APPMGMT . NO
compartmentId Compartment OCID where the agent resides. . YES as per customer environment
agentId The OCID of the management agent monitoring the resource. . YES as per customer environment
resourceType OCI_ORACLE_PDB . NO
resourceName Resource name to display in the Stack monitoring console This can be any name or value like hostname or DB name itself. YES as per customer environment
database_port Listener port database. Ex : 1521 etc YES as per customer environment
database_host_name Host or IP of the server where the database resides. . YES as per customer environment
database_service_name Service name which gives connection to the PDB. . YES as per customer environment
externalContainerDatabaseId OCID of the CDB resource in Stackmon Discover CDB first before PDB discovery. YES as per customer environment
database_protocol tcp or tcps . YES as per customer environment
ssl_secret_id OCID of a SiV (Secret in Vault) that contains the tcps. For more information, see Create an OCI Secret. Applicable only when tcps database_protocol selected YES as per customer environment
credentialName . Keep as is (Default) NO
credentialType . Keep as is (Default) NO
DBUserName Database user who has the necessary privileges to monitor

Update DBUserName in BASE64 encoded format.

Make sure this user exists in PDB and has all necessary privileges as explained in Doc ID 2857604.1

YES as per customer environment

Discovering E-Business Suite

E-Business Suite 12.2 JSON file

{
    "discoveryType": "ADD",
    "discoveryClient": "appmgmt",
    "compartmentId": "<Compartment_OCID>",
    "discoveryDetails": {
        "agentId": "<Agent_OCID>",
        "resourceType": "EBS_INSTANCE",
        "resourceName": "<Target name to display stackmon UI>",
        "properties": {
            "propertiesMap": {
                "ebs_version": "<12.2>",
                "ebs_db_host": "<DB hostname or ip>",
                "ebs_db_port": "<1521 or DB Listener port>",
                "ebs_db_service_name": "<service name pointing to EBS DB>",
                "database_protocol": "<tcp or tcps>",
                "ebs_discover_db": "true",
                "ebs_admin_server_host": "<EBS Admin server host>",
                "ebs_admin_server_port": "<EBS Admin server port, 7001|7002>",
                "ebs_admin_server_protocol": "t3"
            }
        },
        "credentials": {
            "items": [{
                    "properties": {
                        "propertiesMap": {
                            "DBUserName": "<Database user who has the necessary privileges on the underlying V$ views in base64 format>",
                            "DBPassword": "<Database user password in base 64 encoded format ",
                            "DBRole": "<Database user role in base64 encoded encoded format>"
                        }
                    },
                    "credentialName": "U1FMQ3JlZHM=",
                    "credentialType": "REJDcmVkcw=="
                },
                {
                    "properties": {
                        "propertiesMap": {
                            "Username": "<Weblogic user that as monitor role",
                            "Password": "<EBS Weblogic user password>"
                        }
                    },
                    "credentialName": "Sk1YQ3JlZHM=",
                    "credentialType": "Sk1YQ3JlZHM="
                }
            ]
        }
    }
}

E-Business Suite 12.2 with TLS JSON file

{
    "discoveryType": "ADD",
    "discoveryClient": "APPMGMT",
    "compartmentId": "<Compartment_OCID>",
    "discoveryDetails": {
      "agentId": "<Agent_OCID>",
      "resourceType": "EBS_INSTANCE",
      "resourceName": "<Resource name to display in stackmon UI>",
      "properties": {
        "propertiesMap": {
          "ebs_version": "12.2",
          "ebs_db_host": "< EBS DB hostname or IP> ",
          "ebs_db_port": "<EBS DB Listner port>",
          "ebs_db_service_name": "<EBS DB Service name>",
          "database_protocol": "<tcp or tcps>",
          "ebs_admin_server_host": "<EBS weblogic Admin sever host>",
          "ebs_admin_server_port": "<EBS weblogic Admin server port>",
          "ebs_admin_server_protocol": "t3s"
        }
      },
      "credentials": {
        "items": [
          {
            "properties": {
              "propertiesMap": {
                "DBUserName": "<Database user who has the necessary privileges on the underlying V$ views in base64 encoded format>",
                "DBPassword": "<Database user password in base64 encoded format> ",
                "DBRole": "<Database user role base64 encoded format"
              }
            },
            "credentialName": "U1FMQ3JlZHM=",
            "credentialType": "REJDcmVkcw=="
          },
          {
            "properties": {
              "propertiesMap": {
                "Username": "<EBS WebLogic Administration Server user in Base64 encoded format>",
                "Password": "<EBS WebLogic Administration password in Base64 encoded format>",
                "TrustStorePath": "<Path to the TrustStore file used to store public keys of trusted servers>",
                "TrustStoreType": "<Type of the TrustStore used for CA certificate management >"
              }
            },
            "credentialName": "Sk1YQ3JlZHM=",
            "credentialType": "Sk1YQ3JlZHM="
          }
        ]
      }
    }
  }

E-Business Suite 12.2 JSON Input Parameters

JSON Parameter Description Notes Editable or not
discoveryType ADD This ADD entry is for the first time the CDB is going to be discover NO
discoveryClient appmgmt . NO
compartmentId Compartment OCID where the agent resides. . YES as per customer environment
agentId The OCID of the management agent monitoring the resource. . YES as per customer environment
resourceType EBS_INSTANCE . NO
resourceName Resource name to display in the Stack monitoring console This can be any name or value like hostname or DB name itself. YES as per customer environment
ebs_version EBS version 12.2 .
ebs_db_host DB hostname or ip where EBS database is running . YES as per customer environment
ebs_db_port EBS DB listener port ex : 1521 YES as per customer environment
ebs_db_service_name service name pointing to EBS DB ebsdb or ebspdb etc. YES as per customer environment
database_protocol tcp or tcps . YES as per customer environment
ssl_secret_id OCID of a SiV (Secret in Vault) that contains the tcps. For more information, see Create an OCI Secret. Applicable only when tcps database_protocol selected YES as per customer environment
ebs_discover_db true . .
ebs_admin_server_host EBS Weblogic Admin server host . YES as per customer environment
ebs_admin_server_port EBS Weblogic Admin server port Ex : 7001/7002 YES as per customer environment
ebs_admin_server_protocol WLS admin server protocol. t3/t3s YES as per customer environment
TrustStorePath . Only for t3s protocol .
TrustStoreType . Only for t3s protocol .
DBUserName Database user who has the necessary privileges to monitor DBUserName in BASE64 format. YES as per customer environment
DBPassword Password of the db user DBPassword in BASE64 format. YES as per customer environment
DBRole Database user role (Sysdba or normal) DBRole in BASE64 format. YES as per customer environment
credentialName . Keep as is (Default) .
credentialType . Keep as is (Default) .
Username Weblogic user that as monitor role . YES as per customer environment
Password EBS Weblogic user password . YES as per customer environment
credentialName . Keep as is (Default) .
credentialType . Keep as is (Default) .

E-Business Suite 12.1

{
    "discoveryType": "ADD",
    "discoveryClient": "APPMGMT",
    "compartmentId": "<Compartment_OCID>",
    "discoveryDetails": {
        "agentId": "<Agent_OCID>",
        "resourceType": "EBS_INSTANCE",
        "resourceName": "<Target name to display stackmon UI>",
        "properties": {
            "propertiesMap": {
                "ebs_version": "12.1",
                "ebs_db_host": "<DB hostname or ip>",
                "ebs_db_port": "<1521 or DB Listener port>",
                "ebs_db_service_name": "<service name pointing to EBS DB>",
                "database_protocol": "<tcp or tcps>"
            }
        },
        "credentials": {
            "items": [{
                "properties": {
                    "propertiesMap": {
                        "DBUserName": "<Database user who has the necessary privileges on the underlying V$ views in base64 encoded format>",
                        "DBPassword": "<Database user password in base64 encoded format>",
                        "DBRole": "<Database user role,Normal/Sysdba in base64 encoded format>"
                    }
                },
                "credentialName": "U1FMQ3JlZHM=",
                "credentialType": "REJDcmVkcw=="
            }]
        }
    }
}

E-Business Suite 12.1 JSON Input Parameters

JSON Parameter Description Notes Editable or not
discoveryType ADD This ADD entry is for the first time the CDB is going to be discover NO
discoveryClient appmgmt . NO
compartmentId Compartment OCID where the agent resides. . YES as per customer environment
agentId The OCID of the management agent monitoring the resource. . YES as per customer environment
resourceType EBS_INSTANCE . NO
resourceName Resource name to display in the Stack monitoring console This can be any name or value like hostname or DB name itself. YES as per customer environment
ebs_version EBS version 12.1 .
ebs_db_host DB hostname or ip where EBS database is running . YES as per customer environment
ebs_db_port EBS DB listener port 1521 etc YES as per customer environment
ebs_db_service_name service name pointing to EBS DB ebsdb or ebspdb etc. YES as per customer environment
database_protocol tcp or tcps . YES as per customer environment
ssl_secret_id OCID of a SiV (Secret in Vault) that contains the tcps. For more information, see Create an OCI Secret. Applicable only when tcps database_protocol selected YES as per customer environment
DBUserName Database user who has the necessary privileges to monitor DBUserName in BASE64 format. YES as per customer environment
DBPassword Password of the db user DBPassword in BASE64 format. YES as per customer environment
DBRole Database user role (Sysdba or normal) DBRole in BASE64 format. YES as per customer environment
credentialName . Keep as is (Default) .
credentialType . Keep as is (Default) .

Discovering WebLogic Domain

Weblogic

{
    "discoveryType": "ADD",
    "discoveryClient": "APPMGMT",
    "compartmentId": "<Compartment_OCID>",
    "discoveryDetails": {
         "agentId": "<Agent_OCID>",
        "resourceType": "WEBLOGIC_DOMAIN",
        "resourceName": "<Target name to display stackmon UI>",
        "properties": {
            "propertiesMap": {
                "admin_server_host": "<Admin server host>",
                "admin_server_port": "<Admin server port>",
                "admin_server_protocol": "t3"
            }
        },
        "credentials": {
            "items": [
                {
                    "properties": {
                        "propertiesMap": {
                            "Username": "<Weblogic user with monitor role",
                            "Password": "<Weblogic user password>"
                        }
                    },
                    "credentialName": "Sk1YQ3JlZHM=",
                    "credentialType": "Sk1YQ3JlZHM="
                }
            ]
        }
          
    }
}

Weblogic with TLS discovery Json

{
    "discoveryType": "ADD",
    "discoveryClient": "APPMGMT",
    "compartmentId": "<Compartment_OCID>",
    "discoveryDetails": {
        "agentId": "<Agent_OCID>",
        "resourceType": "WEBLOGIC_DOMAIN",
        "resourceName": "<Resource name to display in Stackmonitoring UI>",
        "properties": {
            "propertiesMap": {
                "admin_server_host": "<Admin server host>",
                "admin_server_port": "<Admin server port>",
                "admin_server_protocol": "t3s"
            }
        },
        "credentials": {
            "items": [
                {
                    "properties": {
                        "propertiesMap": {
                            "Username": "<Weblogic user with monitor role in Base64 encoded format>",
                            "Password": "<<Weblogic user password in Base64 encoded format>",
                            "TrustStorePath": "<Full path to the TrustStore file>",
                            "TrustStoreType": "TrustStore file type (JKS or PKCS12)"
                        }
                    },
                    "credentialName": "Sk1YQ3JlZHM=",
                    "credentialType": "Sk1YQ3JlZHM="
                }
            ]
        }
    }
}

WebLogic JSON Input Parameters

JSON Parameter Description Notes Editable or not
discoveryType ADD . NO
discoveryClient appmgmt . NO
compartmentId Compartment OCID where the agent resides. . NO
agentId The OCID of the management agent monitoring the resource. . .
resourceType WEBLOGIC_DOMAIN . NO
resourceName Resource name to display in the Stack monitoring console This can be any name or value like Weblogic domain name or Weblogicdomain_hostname_port etc YES as per customer environment
admin_server_host Weblogic Host where Admin server is running . YES as per customer environment
admin_server_port Admin server port 7001/7002 etc. YES as per customer environment
admin_server_protocol Admin sever protocol t3/t3s YES as per customer environment
TrustStorePath Full path to the TrustStore file Applicable only for t3s YES as per customer environment
TrustStoreType TrustStore file type (JKS or PKCS12) Applicable only for t3s YES as per customer environment
Username Weblogic user name in BASE64 format. Make sure user has monitor role YES as per customer environment
Password Weblogic user password in BASE64 format. . YES as per customer environment
credentialName . Keep as is (Default) NO
credentialType . Keep as is (Default) NO

GoldenGate

Discovering GoldenGate JSON File

This is an example of the JSON used to discover GoldenGate via CLI.

{
   "discoveryType": "ADD",
  "compartmentId": "<Compartment OCID>",
  "discoveryClient": "APPMGMT",
  "discoveryDetails": {
    "resourceName": "<Rsource name>",
    "resourceType": "ORACLE_GOLDENGATE",
    "agentId": "<Management Agent OCID>",
    "credentials": {
      "items": [
        {
          "credentialName": "UmVzdENyZWRz",
          "credentialType": "SFRUUFNDcmVkcw==",
          "properties": {
            "propertiesMap": {
              "Username": "<Base64 encoded username>",
              "Password": "<Base64 encoded password>",
              "TrustStorePath": "<Base64 encided Truststore path>",
              "TrustStoreType": "SktT",
              "TrustStorePassword": "<Base64 encoded Truststroe password>"
            }
          }
        }
      ]
    },
    "license": "ENTERPRISE_EDITION",
    "properties": {
      "propertiesMap": {
        "hostname": "<GoldenGate hostname>",
        "port": "<Port>"
      }
    }
  }
}

Command

./oci stack-monitoring discovery-job create --compartment-id "<Ccompartment OCID>" --from-json file:///path/to/add-goldengate.json

Refreshing GoldenGate JSON File

This is an example of the JSON used to refresh GoldenGate via CLI.

{
  "discoveryType": "REFRESH",
  "compartmentId": "<compartent-id>",
  "discoveryClient": "APPMGMT",
  "discoveryDetails": {
    "resourceName": "<resource_name>",
    "resourceType": "ORACLE_GOLDENGATE",
    "agentId": "<Management Agent Id>",
    "credentials": {
      "items": [
        {
          "credentialName": "UmVzdENyZWRz",
          "credentialType": "SFRUUFNDcmVkcw==",
          "properties": {
            "propertiesMap": {
              "Username": "<Base64 encoded username>",
              "Password": "<Base64 encoded password>",
              "TrustStorePath": "<Base64 encoded "truststore path>",
              "TrustStoreType": "SktT",
              "TrustStorePassword": "<Base64 encoded truststore password>"
            }
          }
        }
      ]
    },
    "license": "ENTERPRISE_EDITION",
    "properties": {
      "propertiesMap": {
        "allow_delete_resources": "true",
        "resource_id": "<resource id>"
      }
    }
  }
}

Command

./oci stack-monitoring discovery-job create --compartment-id "<Compartment OCID>" --from-json file:///path/to/gg-refresh-oclicli.json