HanaDB Monitoring Extension

Use Case

Deployable on premise or in the cloud, SAP HANA is an in-memory data platform that lets you accelerate business processes, deliver more business intelligence, and simplify your IT environment. By providing the foundation for all your data needs, SAP HANA removes the burden of maintaining separate legacy systems and siloed data, so you can run live and make better business decisions in the new digital economy. HanaDB Monitoring Extension gathers metrics and sends them to the AppDynamics Metric Browser.

Prerequisite

  1. This extension requires the Java Machine Agent.
  2. The HanaDB Driverngdbc.jaris required.
  3. A HanaDB User with the following privileges is required:
    1. MONITORING: this role contains privileges for full read-only access to all metadata, the current system status in system and monitoring views, and the data collected by the statistics server.
    2. PUBLIC : this role contains privileges for filtered read-only access to the system views.

Installation

Either Download the Extension from the AppDynamics Marketplace or Download the Extension from the Github release or Build from Source.

  1. Download the HanaDBMonitor-<version>.zip file to the following directory.
    <machine agent home>/monitors

    Run the following command after you have successfully downloaded the .zip file in the correct directory.

    > unzip HanaDBMonitor-<VERSION>.zip -d  <machine agent home>/monitors/
    
  2. Copy the ngdbc.jar in the <machine agent home>/monitors/HanaDBMonitor/ folder
  3. Set up config.yml:
    # HanaDB Servers. If you have Failover Partners please concatenate them here like ":;:"
    hosts:
      - host: ""
    
    # Specify this key if Password Encryption Support is required. If not keep it empty
    # If specified, DBPassword is now the encrypted passwords.
    encryptionPassword: ""
    encryptionKey: ""
    
    # DB username and password.
    # User needs the permissions MONITORING and PUBLIC
    username: ""
    password: ""
    
    jdbcPrefix: "jdbc:sap://"
    jdbcOptions: "?communicationtimeout=2000"
    
    # prefix used to show up metrics in AppDynamics
    metricPathPrefix: "Custom Metrics|HanaDB"
    # This will create it in specific Tier. Replace 
    # metricPrefix:  "Server|Component:|Custom Metrics|HanaDB Server|"
    # number of concurrent tasks
    numberOfThreads: 10
    
    # Metrics can be converted from b (bytes), to kb (kilobytes), to gb (gigabytes), to tb (terabytes).
    # Use the convertFrom and convertTo properties for this.
    queries:
      - statement: "select * from M_DISK_USAGE where USED_SIZE >= 0"
        columns:
         - name: "HOST"
           type: "name"
         - name: "USAGE_TYPE"
           type: "name"
         - name: "USED_SIZE"
           type: "metric"
           convertFrom: ""
           convertTo: ""
      - statement: "select HOST, USED_PHYSICAL_MEMORY, FREE_PHYSICAL_MEMORY from M_HOST_RESOURCE_UTILIZATION"
        columns:
         - name: "HOST"
           type: "name"
         - name: "USED_PHYSICAL_MEMORY"
           type: "metric"
           convertFrom: ""
           convertTo: ""
         - name: "FREE_PHYSICAL_MEMORY"
           type: "metric"
           convertFrom: ""
           convertTo: ""
    
    
  4. Restart the Machine Agent.

Directory Structure

Directory/FileDescription
src/main/resources/configContains monitor.xml and config.yml
src/main/javaContains source code to the HanaDB monitoring extension
targetOnly obtained when using maven. Run 'maven clean install' to get the distributable .zip file.
pom.xmlmaven build script to package the project (required only if changing Java code)

Metrics

Metrics can be configured in the config.ymlfile.

A reference for the HanaDB System Views can be found here

The Queries can be adjusted to your needs to gather metrics from the HanaDB. Please see below example:

queries:
  - statement: "select * from M_DISK_USAGE where USED_SIZE >= 0"
    columns:
     - name: "HOST"
       type: "name"
     - name: "USAGE_TYPE"
       type: "name"
     - name: "USED_SIZE"
       type: "metric"
       convertFrom: ""
       convertTo: ""
  - statement: "select HOST, USED_PHYSICAL_MEMORY, FREE_PHYSICAL_MEMORY from M_HOST_RESOURCE_UTILIZATION"
    columns:
     - name: "HOST"
       type: "name"
     - name: "USED_PHYSICAL_MEMORY"
       type: "metric"
       convertFrom: ""
       convertTo: ""
     - name: "FREE_PHYSICAL_MEMORY"
       type: "metric"
       convertFrom: ""
       convertTo: ""

Password Encryption Support

Please visit this pageto get detailed instructions on password encryption. The steps in this document will guide you through the whole process.

Contributing

Always feel free to fork and contribute any changes directly via GitHub.

Support

For any questions or feature request, please contact AppDynamics Center of Excellence.