jdbc_response - creating a connection to a MySQL Database
search cancel

jdbc_response - creating a connection to a MySQL Database

book

Article ID: 34390

calendar_today

Updated On:

Products

DX Unified Infrastructure Management (Nimsoft / UIM)

Issue/Introduction

Instructions on how to create a connection to a MySQL database using the jdbc_response probe.
 
Depending on OS(Windows/Linux) configuration may vary (refer to your platform's MySQL documentation).

Environment

  • Release: DX UIM 20.4.x / 23.4.X
  • Component: jdbc_probe 

Resolution

Part 1 - On MySQL Server

  1. Enable Remote access for MySQL:
    1. In my.cnf, make MySQL Listen on ethernet IP address:
      Under [mysqld] section:
      bind-address=YOUR-SERVER-IP
      and comment out the following (if exists)
      # skip-networking
    2. Save/exit the file and restart MySQL
      # /etc/init.d/mysql restart
  2. Allow remote access to the MySQL monitoring user:
    1. Login to MySQL using 'mysql' command:
      #mysql -u root <Insert> password
      Change with your 'root' password
    2. Create MySQL monitoring user:
      mysql>create user 'dbuser' identified by 'password';
    3. Grant new user access to monitored database: 
      mysql>grant all on test.* to dbuser@'jdbc_reposne Robot IP Address;
    4. Change the GRANT statement to allow only required permissions per probe help document.

Part 2 - On 'jdbc_response' probe Robot

  1. Download an appropriate MySQL JDBC Driver from the MySQL site for the version you are using.

    example: MySQL Community Downloads

    (A driver for MySQL 8.x is attached to this KB as well.)

    Since this is a .jar file there is no difference between the driver for Windows or for Linux, the same file works on both.
  2. Rename the file (e.g. mysql-connector-java-5.1.10-bin.jar) to mysql.jar for your convenience.
  3. Windows:
    Copy mysql.jar to (UIM_HOME)\Nimsoft\probes\database\jdbc_response\jar\
    Linux:
    Copy mysql.jar to (UIM_HOME)/nimsoft/probes/jdbc_response/lib/
  4. (Windows Only)
    1. In the folder /probes/database/jdbc_response, locate and edit the file called runprobe.bat:
    2. edit the line starting with "set CLASSPATH" as follows:
      set CLASSPATH=jar\jdbc_response.jar;jar\nimsoft.jar;jar\TwoFish.jar;jar\oracle.jar;jar\sql_drv.jar;jar\mysql.jar
      (You need to add the jar\mysql.jar to the end of the existing entry)
      This step is not necessary on Linux.
  5. In jdbc_response probe connection properties, set the URL and driver information as follows:
    • Database URL: jdbc:mysql://##.##.##.##:3306/test
    • Driver Name: com.mysql.jdbc.Driver
    • Driver Path: (path to driver from above)
    • User ID: MySQL user set with right permissions/access
    • Password: MySQL user password
      Windows example driver path:  C:\Program Files (x86)\Nimsoft\probes\database\jdbc_response\jar\mysql.jar
      Linux example driver path:  /opt/nimsoft/probes/database/jdbc_response/lib/mysql.jar

You should now be able to connect the MySQL Server database using the jdbc_response probe.

Additional Information

  1. Make sure you have JRE installed on the jdbc_response probe robot.
  2. On the MySQL server, modify firewall rules to allow connection to MySQL port (default is 3306/tcp).

Attachments

MySqlJdbcDriver.zip get_app