- This article explains how to monitor a non-listed database with Monitoring Studio X.
- Monitoring Studio X
Monitoring a Non-Listed Database with Monitoring Studio X
KB1246 - Mar 19, 2019
Monitoring Studio X supports the monitoring of a wide variety of databases. However, only a few database connectivity drivers are integrated into the KM and listed out-of-the-box. To monitor a non-listed database, you will have to:
- install and configure the database connectivity driver
- use the respective database connection string URL and driver class while configuring the monitoring.
It is a good practice to check the connectivity to the database once the driver is installed and configured before configuring the monitoring in Monitoring Studio.
Checking the Database Connectivity
To connect to the database and execute the query, Monitoring Studio X uses the
X_matsya-module-jdbc.jar file located in
PATROL_HOME\bin. To test the connectivity to the database, you can run the command below:
java -jar X_matsya-module-jdbc.jar <JDBC URL> <-username:<username>> <"SQL statement"> [options...]
<JDBC URL>is the JDBC URL to connect to the database
<username>is the user login used to connect to the database
<"SQL statement">is the SQL statement to be executed by the database
password:<password>to specify the password on the command line (not recommended)
driver:<driverClass>to specify the class of the driver to load to perform the JDBC query
colsep:<column separator>to specify the char used to separate columns in the result (default: ';')
showWarnings:<yes|no>to get the PRINT messages and warnings in the result (default: YES)
timeout:<timeout>to specify the timeout in seconds
To test the connectivity to a non-listed database, you will have to provide the JDBC URL, the database name, and the credentials which will be used for monitoring as described below:
[patrol@SEN-db-maria bin]$ /usr/java/jre1.8.0_141/bin/java -jar X_matsya-module-jdbc.jar 'jdbc:sqlserver://SEN-db-maria:1433;databaseName=SENDBA' -username:sql_patrolmon "select name, state, state_desc, user_access_desc, is_read_only, recovery_model_desc from sys.databases with (nolock)" sql_patrolmon's password: master;0;ONLINE;MULTI_USER;0;SIMPLE; tempdb;0;ONLINE;MULTI_USER;0;SIMPLE; model;0;ONLINE;MULTI_USER;0;FULL; msdb;0;ONLINE;MULTI_USER;0;SIMPLE; SENDBA;0;ONLINE;MULTI_USER;0;SIMPLE; RestoreTest;0;ONLINE;MULTI_USER;0;FULL; test;0;ONLINE;MULTI_USER;0;FULL;
Configuring the Monitoring of a Non-Listed Database
Once you have validated the connection to the non-listed database:
- Launch the Monitoring Studio X Web Interface
- Define the host on which the non-listed database to be monitored is installed
Create your Template:
- In the Database section, select Other Database
- Click Create
- Click Database Query, provide the SQL query to be run, and Save your Monitor
- Save your Template.
Apply your Template to the relevant host. You will then have to provide the URL and Driver class as shown below: