Often, customers wish to do load balancing of replicating databases, and wish to effectively monitor them. The attached Java extension leverages JDBC drivers to connect to the database server, then the monitor issues a query of "select 1" to the database server by default. The monitor accepts the following parameters:
user The user to connect as (required)
password The user's password (required)
type The type of database supported options: "mysql", "mssql", "oracle", or "postgress" (required)
database The name of the database configured i.e. for a "use <database>" command (required)
instance For mssql, the name of the instance to connect to (optional)
service For Oracle, the name of the service (required) (note 1)
query The query to use. Use "~" in place of spaces. (optional--defaults to "select 1") (note 2)
Note 1: The service parameter is required for monitoring Oracle databases
Note 2: A valid query parameter is required for monitoring Oracle databases
Upload the db-monitor.sh and ConnectDBServer.class files to the monitors section in the extra files catalog, and create an appropriate monitor with the options above. The db-monitor.sh is a Bash shells script that can be modified to provide additional support for other database types if needed.
Updated by pwallace to indicated required parameters for Oracle databases