The SQL Query active monitor lets you verify that certain conditions exist in a Microsoft SQL, MySQL, or ORACLE database, based on a database query. You can define the criteria you want to exist in the database and as long as the specified conditions are present, the SQL Query monitor is in an Up state. If the database data changes outside the boundaries of the query criteria, the monitor triggers to a Down state.

The SQL Query monitor is available in Premium Edition. To update your license, visit the WhatsUp Customer Portal.

Prerequisites

To use the SQL Query monitor to monitor a MySQL database, you must first download and install the MySQL .NET Connector on the machine. Only MySQL version 5.2.5 .NET Connector is supported due to compatibility issues. The connector is located on the website (http://www.whatsupgold.com/MySQL525Connector). This link downloads the mysql-connector-net-5.2.5.zip file. After the file downloads, extract the MySQL.Data.msi and run the MySQL Connector setup utility by double-clicking on the MySQL.Data.msi icon. On the Choose Setup Type dialog, select Typical, then click Install. The MySQL .NET Connector is installed in the following location: C:\Program Files\MySQL\MySQL Connector Net 5.2.5\. After the .NET Connector has been installed, restart the machine.

Note: When connecting to a remote SQL instance, only supports the TCP/IP network library.

The SQL Query monitor requires one or more of the following credentials:

  • ADO
  • Windows

Configure the following:

  • Name. Enter a unique name for the monitor. This name displays in the Monitor Library.
  • Description. (Optional) Enter additional information about the monitor. This description displays next to the monitor name in the Monitor Library.
  • Server Type. Select Microsoft SQL Server, MySQL, or ORACLE as the database server type. MySQL database is supported and listed as a server type option only if the MySQL 5.2.5 Connector is installed.
  • Connection Timeout (sec). Enter the amount of time waits for the server to respond before terminating the connection and returning the timeout error. Minimum allowed value is 1 second whereas maximum allowed value is 120. The default value is 15 seconds. The connection timeout setting configured by the user is used for polling only; the query builder does not use it. Instead, the query builder assumes a default of 15 seconds for the connection timeout.
  • Server Address. Enter ServerName\Instance format for Microsoft SQL Server (for example, WUGServer\SQLEXPRESS), ServerName for MySQL (for example, WUGServer), or ServerName/ServiceName for Oracle (for example, WUGServer/Oracle). When using an Oracle server type, the SQL query monitor does not make use of the tsnnames.ora file on the client (i.e. system).
  • Port (optional). Enter the database server port number if other than the standard database port number.
  • SQL Query to Run. Enter a query you want to run against a database to monitor and check for certain database conditions. Only SELECT queries are allowed.

    Include the full database name in your query. For query help, click Build. The SQL Query Builder assists you in developing proper query syntax.

    The SQL query you enter must return a single numeric value. Specifically, a single record that has just one column. If the query returns more than one record, the monitor fails to store the data. If the query returns a single record but there are multiple columns in the record returned, then the monitor picks the first column as the value to store and this first column has to be numeric, otherwise the monitor fails to store the data.

  • Build. Click to open the SQL Query Builder dialog for assistance building queries.
  • Verify. Click to check that the query is valid. If there is a syntax error with the SQL query, a message appears with tips about the syntax issue.
  • Number of rows returned is. Select this option to determine the success or failure of the monitor scan based on rows returned by the SQL query.
  • For the following options, select the appropriate variables to determine the success or failure of the monitor scan:
    • less than
    • less than or equal to
    • greater than
    • greater than or equal to
    • equal to
    • not equal to
  • Enter a numeric value for number of rows in the box to the right of the conditions list.
  • Content of each retrieved row matches the following criteria. Select to set criteria that each database row must match to determine the success or failure of the monitor scan.

    All database rows must match the criteria settings in the Monitor is up if section for the monitor to be considered up. If multiple threshold criteria is used in the Content of each retrieved row matches the following criteria, all thresholds must match the criteria in each row.

    • Add. Click to open the New Row Content Threshold dialog. This dialog lets you set the database column values and conditions that must be matched for each table row.
    • Edit. Click to modify the existing row criteria.
    • Delete. Click to remove existing row criteria.

      As you specify the desired monitor criteria settings, this description updates to verbally illustrate the monitor you have configured.