Versions Compared

    Key

    • This line was added.
    • This line was removed.
    • Formatting was changed.
    Comment: Published by Scroll Versions from this space and version 20.8-next
    Sv translation
    languageen

     

    Appd tocbox

    Related pages:

    This page describes the Database Visibility API methods you can use to get, create, update, and delete Database Visibility Collectors.

    Include the following headers for all Database Visibility API requests:

    Code Block
    Accept: application/json; Content-type: application/json

    JSON is currently the only supported format.

    Get All Collectors

    Code Block
    GET /controller/rest/databases/collectors

    Anchor
    GetSpecificCollector
    GetSpecificCollector
    Get a Specific
     Collector 

    Code Block
    GET /controller/rest/databases/collectors/{configurationId}

    Create a Collector 

    Code Block
    POST /controller/rest/databases/collectors/create

    The JSON you send must contain the relevant Collector information. The required fields describing the Collector vary based on the type of database. See UI Collector versus JSON Collector Configuration Field Names

    Example JSON Request 

    Code Block
    { 
     "type":"MYSQL",
     "name":"localdocker_dbagent-MySQLCollector",
     "hostname":"mysql",
     "port":"3306",
     "username":"root",
     "password":"appdynamics_redacted_password",
     "enabled":true,
     "excludedSchemas":null,
     "databaseName":null,
     "failoverPartner":null,
     "connectAsSysdba":false,
     "useServiceName":false,
     "sid":null,
     "customConnectionString":null,
     "enterpriseDB":false,
     "useSSL":false,
     "enableOSMonitor":false,
     "hostOS":null,
     "useLocalWMI":false,
     "hostDomain":null,
     "hostUsername":null,
     "hostPassword":"",
     "dbInstanceIdentifier":null,
     "region":null,
     "certificateAuth":false,
     "removeLiterals":true,
     "sshPort":0,
     "agentName":"localdocker_dbagent",
     "dbCyberArkEnabled":false,
     "dbCyberArkApplication":null,
     "dbCyberArkSafe":null,
     "dbCyberArkFolder":null,
     "dbCyberArkObject":null,
     "hwCyberArkEnabled":false,
     "hwCyberArkApplication":null,
     "hwCyberArkSafe":null,
     "hwCyberArkFolder":null,
     "hwCyberArkObject":null,
     "orapkiSslEnabled":false,
     "orasslClientAuthEnabled":false,
     "orasslTruststoreLoc":null,
     "orasslTruststoreType":null,
     "orasslTruststorePassword":"",
     "orasslKeystoreLoc":null,
     "orasslKeystoreType":null,
     "orasslKeystorePassword":"",
     "ldapEnabled":false,
     "customMetrics":null,
     "subConfigs":[
     {
     "type":"MYSQL",
     "name":"localdocker_dbagent-MySQLCollector sub-collector",
     "hostname":"mysql-remote",
     "port":"3388",
     "username":"root",
     "password":"different-password",
     "enabled":true,
     "excludedSchemas":null,
     "databaseName":null,
     "failoverPartner":null,
     "connectAsSysdba":false,
     "useServiceName":false,
     "sid":null,
     "customConnectionString":null,
     "enterpriseDB":false,
     "useSSL":false,
     "enableOSMonitor":false,
     "hostOS":null,
     "useLocalWMI":false,
     "hostDomain":null,
     "hostUsername":null,
     "hostPassword":"",
     "dbInstanceIdentifier":null,
     "region":null,
     "certificateAuth":false,
     "removeLiterals":true,
     "sshPort":0,
     "agentName":"localdocker_dbagent",
     "dbCyberArkEnabled":false,
     "dbCyberArkApplication":null,
     "dbCyberArkSafe":null,
     "dbCyberArkFolder":null,
     "dbCyberArkObject":null,
     "hwCyberArkEnabled":false,
     "hwCyberArkApplication":null,
     "hwCyberArkSafe":null,
     "hwCyberArkFolder":null,
     "hwCyberArkObject":null,
     "orapkiSslEnabled":false,
     "orasslClientAuthEnabled":false,
     "orasslTruststoreLoc":null,
     "orasslTruststoreType":null,
     "orasslTruststorePassword":"",
     "orasslKeystoreLoc":null,
     "orasslKeystoreType":null,
     "orasslKeystorePassword":"",
     "ldapEnabled":false,
     "customMetrics":null
     }
     ]
    }

    Anchor
    extraProperties
    extraProperties

    extraProperties: To configure the frequency for sampling queries from the database (except Cassandra), you can use the extraProperties parameter in the JSON request payload. The following JSON sample can be used in the request payload to configure the sampling interval:

    Code Block
    { "type":"POSTGRESQL",
    "agentName":"UpgradeTest204",
    "name":"SamplingInterval",
    "hostname":"ec2-54-202-140-213.us-west-2.compute.amazonaws.com",
    "port":"5432",
    "username":"postgres",
    "password":"Appd123",
    "removeLiterals":"true",
    "enableOSMonitor":"true",
    "hostOS":"LINUX",
    "sshPort":"22",
    "hostUsername":"ec2-user",
    "hostPassword":"",
    "certificateAuth":true,
    "enabled":"true",
    "enterpriseDB":"false",
    "extraProperties":[ {
    "key":"dbagent.sampling.interval",
    "value":"10",
    "sensitive":false
    
    }
    ]
    }
    
    

    The following JSON key-value pair is used in extraProperties for configuring the interval:

    keydbagent.sampling.interval

    value: positive integer 

    The value can be 1, 2, 5, 10, 20, or 30.

    You can configure this property through the agent. See Configure the Agent Settings for Monitoring Database

    Update a Collector  

    1. Make a GET request for the collector that you want to update.
    2. Copy the JSON response body that is returned by the GET request to a text editor, and modify the fields that you want to update.
    3. Make a POST request for the collector that you want to update, and include the updated JSON. 

      Code Block
      POST /controller/rest/databases/collectors/update

      Example JSON Request

      Code Block
      {
       "id":1,
       "type":"MYSQL",
       "name":"localdocker_dbagent-MySQLCollector",
       "hostname":"mysql",
       "port":"3306",
       "username":"root",
       "password":"appdynamics_redacted_password",
       "enabled":true,
       "excludedSchemas":null,
       "databaseName":null,
       "failoverPartner":null,
       "connectAsSysdba":false,
       "useServiceName":false,
       "sid":null,
       "customConnectionString":null,
       "enterpriseDB":false,
       "useSSL":false,
       "enableOSMonitor":false,
       "hostOS":null,
       "useLocalWMI":false,
       "hostDomain":null,
       "hostUsername":null,
       "hostPassword":"",
       "dbInstanceIdentifier":null,
       "region":null,
       "certificateAuth":false,
       "removeLiterals":true,
       "sshPort":0,
       "agentName":"localdocker_dbagent",
       "dbCyberArkEnabled":false,
       "dbCyberArkApplication":null,
       "dbCyberArkSafe":null,
       "dbCyberArkFolder":null,
       "dbCyberArkObject":null,
       "hwCyberArkEnabled":false,
       "hwCyberArkApplication":null,
       "hwCyberArkSafe":null,
       "hwCyberArkFolder":null,
       "hwCyberArkObject":null,
       "orapkiSslEnabled":false,
       "orasslClientAuthEnabled":false,
       "orasslTruststoreLoc":null,
       "orasslTruststoreType":null,
       "orasslTruststorePassword":"",
       "orasslKeystoreLoc":null,
       "orasslKeystoreType":null,
       "orasslKeystorePassword":"",
       "ldapEnabled":false,
       "customMetrics":null,
       "subConfigs":[
       {
       "id":2,
       "type":"MYSQL",
       "name":"localdocker_dbagent-MySQLCollector sub-collector",
       "hostname":"mysql",
       "port":"3388",
       "username":"root",
       "password":"appdynamics-redacted-password",
       "enabled":true,
       "excludedSchemas":null,
       "databaseName":null,
       "failoverPartner":null,
       "connectAsSysdba":false,
       "useServiceName":false,
       "sid":null,
       "customConnectionString":null,
       "enterpriseDB":false,
       "useSSL":false,
       "enableOSMonitor":false,
       "hostOS":null,
       "useLocalWMI":false,
       "hostDomain":null,
       "hostUsername":null,
       "hostPassword":"",
       "dbInstanceIdentifier":null,
       "region":null,
       "certificateAuth":false,
       "removeLiterals":true,
       "sshPort":0,
       "agentName":"localdocker_dbagent",
       "dbCyberArkEnabled":false,
       "dbCyberArkApplication":null,
       "dbCyberArkSafe":null,
       "dbCyberArkFolder":null,
       "dbCyberArkObject":null,
       "hwCyberArkEnabled":false,
       "hwCyberArkApplication":null,
       "hwCyberArkSafe":null,
       "hwCyberArkFolder":null,
       "hwCyberArkObject":null,
       "orapkiSslEnabled":false,
       "orasslClientAuthEnabled":false,
       "orasslTruststoreLoc":null,
       "orasslTruststoreType":null,
       "orasslTruststorePassword":"",
       "orasslKeystoreLoc":null,
       "orasslKeystoreType":null,
       "orasslKeystorePassword":"",
       "ldapEnabled":false,
       "customMetrics":null
       }
       ]
       }

    The JSON you send must contain all the details of the existing collector with only the fields that you want to modify changed. To ensure you have all the fields, use the Get a Specific Collector call.

    To add a new sub-collector to an existing collector, provide the sub-collector details without the id field. 


    Info
    To configure the interval for sampling queries, refer to the extraProperties parameter in the JSON request payload as mentioned in extraProperties under Create a Collector.

    Delete a Specific Collector  

    Code Block
    DELETE /controller/rest/databases/collectors/{configurationId}

    Example Delete Request

    Code Block
    DELETE /controller/rest/databases/collectors/{1}

    Batch Delete Multiple Collectors   

    Code Block
    POST /controller/rest/databases/collectors/batchDelete

    Send an array of the configuration Ids of the Collectors.

    Below is an example of a batch delete command.

    Code Block
    curl --user {username}@{account_name}:{password} -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '[1,2,3]' {Controller_URL}/controller/rest/databases/collectors/batchDelete 

    Get All Monitored Database Servers

    Code Block
    GET /controller/rest/databases/servers

    Example

    Code Block
    curl --user {username}@{account_name}:{password} {Controller_URL}/controller/rest/databases/servers

    The output is a list of database servers and their details.

    Get Database Server Details

    Code Block
    GET /controller/rest/databases/servers/{dbserver_id}

    Example

    Code Block
    curl --user {username}@{account_name}:{password} {Controller_URL}/controller/rest/databases/servers/{dbserver_id}

    The output contains a list of the database's details, including name, node ID, and database type.

    Get all Database Agent Events

    Code Block
    GET /controller/rest/applications/_dbmon/events

    For a list of query string parameters, see Retrieve Event Data.

    Example

    Code Block
    curl --user {username}@{account_name}:{password} {Controller_URL}/controller/rest/applications/_dbmon/events?time-range-type=BEFORE_NOW&duration-in-mins=30&event-types=%20AGENT_EVENT,DB_SERVER_PARAMTER_CHANGE&severities=INFO,WARN,ERROR

    The output gives you a list of events. For each event element, you can determine the node that the event is mapped to by looking for the entity-definition element.

    Get all Database Monitoring Application Nodes

    Code Block
    GET /controller/rest/applications/_dbmon/nodes

    Example

    Code Block
    curl --user {username}@{account_name}:{password} {Controller_URL}/controller/rest/applications/_dbmon/nodes

    Anchor
    UICollectorversusJSONCollector
    UICollectorversusJSONCollector
    UI Collector versus JSON Collector Configuration Field Names

    Use the table below to ensure you use the correct field names for your API calls. The Collector configuration field names are described in Configure the Database Agent to Monitor Server Hardware and Add Database Collectors.

    SectionUI Collector Configuration Field NameJSON Collector Configuration Field Name


    id (AppDynamics assigns this ID to the Collector when you configure the Collector. You need this ID when doing a batch delete.)

    Database Type type

    Database Agent agentName

    Database name
    Connection DetailsHostname/IP Address hostname

    EnterpriseDB enterpriseDB

    Failover PartnerfailoverPartner

    Listener Port port

    Custom JDBC Connection String customConnectionString

    Use Service NameuseServiceName

    SID or SERVICE_NAMEsid

    Connect as a sysdba connectAsSysdba

    Username  username

    Passwordpassword

    Logging Enabled
    Hardware MonitoringMonitor Operating SystemenableOSMonitor

    Operating SystemhostOS

    Use Local WMIuseLocalWMI

    DomainhostDomain

    SSH PortsshPort

    Use certificatecertificateAuth

    UsernamehostUsername

    PasswordhostPassword
    Info
    titleSSL field
    In addition to JSON Configuration Fields, there is the SSL field. SSL is a configurable property for the Database Agent. If the Database Agent has been configured to use SSL, then you must also provide the SSL field and its value in your Database Visibility API calls.
    Sv translation
    languageja

     

    Appd tocbox

    On this page:

    Table of Contents
    maxLevel2

    Related pages:

    データベースの可視性 API を使用して、データベースの可視性コレクタの取得、作成、更新、および削除を行います。

    すべてのデータベースの可視性 API リクエストには、次のヘッダーを含めます。

    Code Block
    Accept: application/json; Content-type: application/json

    JSON は現在サポートされている唯一の形式です

    すべてのコレクタの取得

    Code Block
    GET /controller/rest/databases/collectors

    特定のコレクタの取得

    Code Block
    GET /controller/rest/databases/collectors/{configurationId}

    コレクタの作成

    Code Block
    POST /controller/rest/databases/collectors/create

    送信する JSON には、関連するコレクタ情報が含まれている必要があります。コレクタを説明する必須フィールドは、データベースのタイプによって異なります。詳細については、後続の「UI コレクタと JSON コレクタの設定フィールド名」セクションの表を参照してください。

    次に、JSON リクエストペイロードの例を示します。

    Code Block
    { 
     "type":"MYSQL",
     "name":"localdocker_dbagent-MySQLCollector",
     "hostname":"mysql",
     "port":"3306",
     "username":"root",
     "password":"appdynamics_redacted_password",
     "enabled":true,
     "excludedSchemas":null,
     "databaseName":null,
     "failoverPartner":null,
     "connectAsSysdba":false,
     "useServiceName":false,
     "sid":null,
     "customConnectionString":null,
     "enterpriseDB":false,
     "useSSL":false,
     "enableOSMonitor":false,
     "hostOS":null,
     "useLocalWMI":false,
     "hostDomain":null,
     "hostUsername":null,
     "hostPassword":"",
     "dbInstanceIdentifier":null,
     "region":null,
     "certificateAuth":false,
     "removeLiterals":true,
     "sshPort":0,
     "agentName":"localdocker_dbagent",
     "dbCyberArkEnabled":false,
     "dbCyberArkApplication":null,
     "dbCyberArkSafe":null,
     "dbCyberArkFolder":null,
     "dbCyberArkObject":null,
     "hwCyberArkEnabled":false,
     "hwCyberArkApplication":null,
     "hwCyberArkSafe":null,
     "hwCyberArkFolder":null,
     "hwCyberArkObject":null,
     "orapkiSslEnabled":false,
     "orasslClientAuthEnabled":false,
     "orasslTruststoreLoc":null,
     "orasslTruststoreType":null,
     "orasslTruststorePassword":"",
     "orasslKeystoreLoc":null,
     "orasslKeystoreType":null,
     "orasslKeystorePassword":"",
     "ldapEnabled":false,
     "customMetrics":null,
     "subConfigs":[
     {
     "type":"MYSQL",
     "name":"localdocker_dbagent-MySQLCollector sub-collector",
     "hostname":"mysql-remote",
     "port":"3388",
     "username":"root",
     "password":"different-password",
     "enabled":true,
     "excludedSchemas":null,
     "databaseName":null,
     "failoverPartner":null,
     "connectAsSysdba":false,
     "useServiceName":false,
     "sid":null,
     "customConnectionString":null,
     "enterpriseDB":false,
     "useSSL":false,
     "enableOSMonitor":false,
     "hostOS":null,
     "useLocalWMI":false,
     "hostDomain":null,
     "hostUsername":null,
     "hostPassword":"",
     "dbInstanceIdentifier":null,
     "region":null,
     "certificateAuth":false,
     "removeLiterals":true,
     "sshPort":0,
     "agentName":"localdocker_dbagent",
     "dbCyberArkEnabled":false,
     "dbCyberArkApplication":null,
     "dbCyberArkSafe":null,
     "dbCyberArkFolder":null,
     "dbCyberArkObject":null,
     "hwCyberArkEnabled":false,
     "hwCyberArkApplication":null,
     "hwCyberArkSafe":null,
     "hwCyberArkFolder":null,
     "hwCyberArkObject":null,
     "orapkiSslEnabled":false,
     "orasslClientAuthEnabled":false,
     "orasslTruststoreLoc":null,
     "orasslTruststoreType":null,
     "orasslTruststorePassword":"",
     "orasslKeystoreLoc":null,
     "orasslKeystoreType":null,
     "orasslKeystorePassword":"",
     "ldapEnabled":false,
     "customMetrics":null
     }
     ]
    }

    コレクタの更新

    1. 更新するコレクタの GET リクエストを実行します。
    2. GET リクエストによって返された JSON 応答本文をテキストエディタにコピーし、更新するフィールドを変更します。
    3. 更新するコレクタの POST リクエストを実行し、更新された JSON を含めます。 

      Code Block
      POST /controller/rest/databases/collectors/update

      次に、JSON リクエストペイロードの例を示します。

      Code Block
      {
       "id":1,
       "type":"MYSQL",
       "name":"localdocker_dbagent-MySQLCollector",
       "hostname":"mysql",
       "port":"3306",
       "username":"root",
       "password":"appdynamics_redacted_password",
       "enabled":true,
       "excludedSchemas":null,
       "databaseName":null,
       "failoverPartner":null,
       "connectAsSysdba":false,
       "useServiceName":false,
       "sid":null,
       "customConnectionString":null,
       "enterpriseDB":false,
       "useSSL":false,
       "enableOSMonitor":false,
       "hostOS":null,
       "useLocalWMI":false,
       "hostDomain":null,
       "hostUsername":null,
       "hostPassword":"",
       "dbInstanceIdentifier":null,
       "region":null,
       "certificateAuth":false,
       "removeLiterals":true,
       "sshPort":0,
       "agentName":"localdocker_dbagent",
       "dbCyberArkEnabled":false,
       "dbCyberArkApplication":null,
       "dbCyberArkSafe":null,
       "dbCyberArkFolder":null,
       "dbCyberArkObject":null,
       "hwCyberArkEnabled":false,
       "hwCyberArkApplication":null,
       "hwCyberArkSafe":null,
       "hwCyberArkFolder":null,
       "hwCyberArkObject":null,
       "orapkiSslEnabled":false,
       "orasslClientAuthEnabled":false,
       "orasslTruststoreLoc":null,
       "orasslTruststoreType":null,
       "orasslTruststorePassword":"",
       "orasslKeystoreLoc":null,
       "orasslKeystoreType":null,
       "orasslKeystorePassword":"",
       "ldapEnabled":false,
       "customMetrics":null,
       "subConfigs":[
       {
       "id":2,
       "type":"MYSQL",
       "name":"localdocker_dbagent-MySQLCollector sub-collector",
       "hostname":"mysql",
       "port":"3388",
       "username":"root",
       "password":"appdynamics-redacted-password",
       "enabled":true,
       "excludedSchemas":null,
       "databaseName":null,
       "failoverPartner":null,
       "connectAsSysdba":false,
       "useServiceName":false,
       "sid":null,
       "customConnectionString":null,
       "enterpriseDB":false,
       "useSSL":false,
       "enableOSMonitor":false,
       "hostOS":null,
       "useLocalWMI":false,
       "hostDomain":null,
       "hostUsername":null,
       "hostPassword":"",
       "dbInstanceIdentifier":null,
       "region":null,
       "certificateAuth":false,
       "removeLiterals":true,
       "sshPort":0,
       "agentName":"localdocker_dbagent",
       "dbCyberArkEnabled":false,
       "dbCyberArkApplication":null,
       "dbCyberArkSafe":null,
       "dbCyberArkFolder":null,
       "dbCyberArkObject":null,
       "hwCyberArkEnabled":false,
       "hwCyberArkApplication":null,
       "hwCyberArkSafe":null,
       "hwCyberArkFolder":null,
       "hwCyberArkObject":null,
       "orapkiSslEnabled":false,
       "orasslClientAuthEnabled":false,
       "orasslTruststoreLoc":null,
       "orasslTruststoreType":null,
       "orasslTruststorePassword":"",
       "orasslKeystoreLoc":null,
       "orasslKeystoreType":null,
       "orasslKeystorePassword":"",
       "ldapEnabled":false,
       "customMetrics":null
       }
       ]
       }

    送信する JSON には、変更するフィールドだけを変更し、既存のコレクタのすべての詳細を含める必要があります。すべてのフィールドがあることを確認するには、「特定のコレクタの取得」コールを使用します。

    既存のコレクタに新しいサブコレクタを追加するには、id フィールドを使用せずにサブコレクタの詳細を指定します。 

    特定のコレクタの削除

    Code Block
    DELETE /controller/rest/databases/collectors/{configurationId}

    次に、削除リクエストの例を示します。

    Code Block
    DELETE /controller/rest/databases/collectors/{1}

    複数のコレクタの一括削除

    Code Block
    POST /controller/rest/databases/collectors/batchDelete

    コレクタの構成 ID の配列を送信します。

    次に、batch delete コマンドの例を示します。

    Code Block
    curl --user {username}@{account_name}:{password} -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '[1,2,3]' {Controller_URL}/controller/rest/databases/collectors/batchDelete 

    すべてのモニタ対象データベースサーバの取得

    Code Block
    GET /controller/rest/databases/servers

    Code Block
    curl --user {username}@{account_name}:{password} {Controller_URL}/controller/rest/databases/servers

    出力は、データベースサーバとその詳細のリストです。

    データベースサーバの詳細の取得

    Code Block
    GET /controller/rest/databases/servers/{dbserver_id}

    Code Block
    curl --user {username}@{account_name}:{password} {Controller_URL}/controller/rest/databases/servers/{dbserver_id}

    出力には、名前、ノード ID、データベースタイプなど、データベースの詳細のリストが含まれます。

    すべてのデータベース エージェント イベントの取得

    Code Block
    GET /controller/rest/applications/_dbmon/events

    クエリ文字列パラメータのリストについては、「イベントデータを取得する」を参照してください。

    Code Block
    curl --user {username}@{account_name}:{password} {Controller_URL}/controller/rest/applications/_dbmon/events?time-range-type=BEFORE_NOW&duration-in-mins=30&event-types=%20AGENT_EVENT,DB_SERVER_PARAMTER_CHANGE&severities=INFO,WARN,ERROR

    出力には、イベントのリストが表示されます。各イベント要素では、エンティティ定義要素を検索することにより、イベントがマッピングされるノードを判別できます。

    すべてのデータベース モニタリング アプリケーション ノードの取得

    Code Block
    GET /controller/rest/applications/_dbmon/nodes

    Code Block
    curl --user {username}@{account_name}:{password} {Controller_URL}/controller/rest/applications/_dbmon/nodes

    UI コレクタと JSON コレクタの設定フィールド名

    次の表を使用して、API コールに正しいフィールド名を使用していることを確認します。コレクタ設定フィールド名については、「Configure the Database Agent to Monitor Server Hardware」および「Add Database Collectors」を参照してください。

    セクションUI コレクタの設定フィールド名JSON コレクタの設定フィールド名
      id(コレクタを設定するときに、AppDynamics がこの ID をコレクタに割り当てます。この ID は、バッチ削除の実行時に必要になります)。
     Database Type type
     Database Agent agentName
     Database name
    Connection DetailsHostname/IP Address hostname
     EnterpriseDB enterpriseDB
     Failover PartnerfailoverPartner
     Listener Port port
     Custom JDBC Connection StringcustomConnectionString
     Use Service NameuseServiceName
     SID or SERVICE_NAMEsid
     Connect as a sysdba connectAsSysdba
     Username  username
     パスワードパスワード
     有効なロギング 
    Hardware MonitoringMonitor Operating SystemenableOSMonitor
     オペレーティングシステムhostOS
     Use Local WMIuseLocalWMI
     ドメインhostDomain
     SSHポートsshPort
     Use certificatecertificateAuth
     ユーザ名hostUsername
     パスワードhostPassword
    Info
    titleSSL フィールド
    上記の JSON 設定フィールドに加えて、[ssl] フィールドもあります。SSL は、データベースエージェントの設定可能なプロパティです。データベースエージェントが SSL を使用するように設定されている場合は、データベースの可視性 API コールで [ssl] フィールドとその値も指定する必要があります。