Database Query Monitor Settings Description Checks that a database is working correctly by connecting to it and performing a query. Optionally, it can check the results of a database query for expected content. Use this page to add the monitor or edit the monitor's properties. To access: Select the Monitors context. In the monitor tree, right-click a group, select New > Monitor, and select the monitor from the New Monitor Page. Important Information Monitors must be created in a group in the monitor tree. The Database Connection Tool is available when configuring this monitor to test and verify connectivity between SiteScope and an external ODBC or JDBC compatible database (provided you are an administrator in SiteScope, or a user granted Use monitor tools permissions). To use the tool when configuring or editing a monitor, click the Use Tool button. For details on the tool, see Database Connection Tool. Included in Tasks Configure the Database Query Monitoring Environment Deploy a Monitor – Workflow Useful Links Monitor Tree Database Query Monitor Overview The monitor specific settings are described below. For details on the settings common to all monitors, click here. Database Query Monitor Settings The following elements are included (unlabeled GUI elements are shown in angle brackets): GUI Element Description Database Enter a URL to a database connection (no spaces are allowed in the URL). One connection way to create a database connection is to use ODBC to create a named connection URL to a database. Example: First use the ODBC control panel to create a connection called test. Then, enter jdbc:odbc:test as the connection URL. Note for using Windows Authentication: If you want to access the database using Windows authentication, enter jdbc:mercury:sqlserver://<server name or IP address>:1433;DatabaseName=<database name>;AuthenticationMethod=type2 as the connection URL, and com.mercury.jdbc.sqlserver.SQLServerDriver as your database driver. Leave the Database user name and Database password boxes empty, because the Windows user credentials of the account from which the SiteScope service is running are used to establish a connection to the database. Database driver Enter the java class name of the JDBC database driver. The default driver uses ODBC to make database connections. SiteScope uses the same database driver for both primary and backup database connections. If a custom driver is used, the driver must also be installed in the <SiteScope root directory>\WEB-INF\lib directory. Default value: sun.jdbc.odbc.JdbcOdbcDriver Database Enter the user name used to log in to the database. user name If you are using Microsoft SQL server and the default driver (Sun Microsystem JDBC-ODBC bridge driver, sun.jdbc.odbc.JdbcOdbcDriver), you can leave this blank and choose NT Authentication when you setup the ODBC connection. With NT Authentication, SiteScope connects using the login account of the SiteScope service. Note: The specified user name must have privileges to run the query specified for the monitor. Database password Enter a password used to login to the database. If you are using Microsoft SQL server and the default driver (Sun Microsystem JDBC ODBC bridge driver (sun.jdbc.odbc.JdbcOdbcDriver), you can leave this blank and choose NT Authentication when you create the ODBC connection. With NT Authentication, SiteScope connects using the login account of the SiteScope service. Query Enter the SQL query to test. Example: select * from sysobjects Match content Enter a string of text to check for in the query result. If the text is not contained in the result, the monitor displays no match on content. This works for XML tags as well. You may also perform a Perl regular expression match by enclosing the string in forward slashes, with an i after the trailing slash indicating case-insensitive matching. Example: /href=Doc\d+\.html/ or /href=doc\d+\.html/i If you want a particular piece of text to be saved and displayed as part of the status, use parentheses in a Perl regular expression. Example: /Temperature: (\d+)/ would return the temperature as it appears on the page and this could be used when setting an Error if or Warning if threshold. Note: The search is case sensitive. You can click the Open Tool button to use the Regular Expression Test tool to check your regular expressions. For details, see Regular Expression Tool. File path Enter the name of the file that contains the query you want to run. The file should be in a simple text format. Use this function as an alternative to the Query text box for complex queries or queries that change and are updated by an external application. Column labels Enter the field labels for the two columns returned by the query, separated by a comma (","). These column labels are used as data labels in SiteScope reports for Database Query Monitors. Note: The field labels should be two of the labels that are returned by the Query string entered above. Database machine name If you are reporting monitor data to an installation of HP Business Availability Center, enter a text identifier describing the database server that this monitor is monitoring. This text descriptor is used to identify the database server when the monitor data is viewed in an HP Business Availability Center report. Database Connection Settings Description The Database Connection Settings enable you to retrieve, share, and reuse database connections for database monitors that use any JDBC-compliant driver. When multiple database monitors use the same database, using a connection pool instead of an open connection for each monitor improves monitor performance and optimizes database server resource utilization. Connections can be shared regardless of monitor type. For example, SiteScope database logger, database tools (Database Connection, Database Information), database alerts, and database monitors (Oracle Database, Database Counter, Database Query, DB2 8.x and 9.x, Technology Database Integration, and so forth) can share and reuse database connections in a connection pool. Important Information You can set additional database options that affect all resources that connect to the database in the JDBC Global Options in Preferences > General Preferences. Useful Links JDBC Global Options The following elements are included (unlabeled GUI elements are shown in angle brackets): GUI Element Use connection pool Description Enables SQL connection sharing. This means that you use a connection pool rather than open and close a new connection for each monitor query. Default value: Selected Physically close if The maximum number of unused SQL connections in the SQL idle connection connection pool. When this number is exceeded, unused connections count exceeds are closed rather than returned to the connection pool. Default value: 10 Idle connection timeout The maximum amount of time, in seconds/minutes/hours/days, that a SQL connection remains unused after it has been returned to the SQL connection pool. When the time is exceeded, the connection is automatically closed. Default value: 5 minutes Query timeout The amount of time, in seconds/minutes/hours/days, to wait for execution of a SQL statement. Not all SQL drivers have this function. If your SQL driver does not support this function, this parameter is ignored. Default value: 1 minute