Using the SQL Query Monitor

This monitor lets you check that certain conditions exists in a Microsoft SQL or MySQL 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.

After the monitor is configured on this dialog, you must assign the monitor to a device through the Device Properties > Active Monitors dialog.

Note: The SQL Query monitor does not support Windows authentication. Make sure that ADO credentials are set up in the Credentials Library for the database for which you want to query. The Credentials system stores ADO database credentials information in your WhatsUp Gold database to be used when a database connection is required. For more information, see Using Credentials.

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

To configure a SQL Query Monitor:

  1. Go to the Active Monitor Library.
    • From the web interface, click GO. The GO menu appears.
    • If the WhatsUp section is not visible, click WhatsUp. The WhatsUp section of the GO menu appears.
    • Select Configure > Active Monitor Library. The Active Monitor Library appears.

      - or -

    • From the main menu bar of the console, select Configure > Active Monitor Library. The Active Monitor Library appears.
  2. In the Active Monitor Library, do one of the following:
    • Click New, then select SQL Server Monitor.

      - or -

    • Select an existing SQL Server Monitor, then click Edit. The monitor properties page appears.
  3. Enter or select the appropriate information in the following fields.
    • Name. Enter a title for the SQL Monitor as it will appear in the Active Monitor Library.
    • Description. Enter a short description for the monitor as it will appear in the Active Monitor Library.

      Server Properties

      • Server Type. Select the database server type.

        Note: MySQL database is supported and will be listed as a Server Type option if the MySQL 5.2 or later .NET connector is installed. You can download the connector on the MySQL Connectors Download site.

      • Server Address. Enter the server address, in the ServerName\Instance format.

        Note: The ServerName\Instance format is only required for SQL Server. MySQL only requires the ServerName.

      • 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.

      Important: Make sure that you include the full database name in your query. For query help, click Build. The SQL Query Builder will assist you in developing proper query syntax.

      • 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 will appear with tips about the syntax issue.

        Monitor is up if

        Important: 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.

    • 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.

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

To add a SQL Query Monitor to a device:

  1. On the device list, find the device that represents the SQL server. Right-click the device, then select Properties. Select Active Monitors.
  2. Click Add. The Active Monitor Wizard appears.
  3. Select the monitor, and continue with the wizard to configure any actions for the monitor.

For more information about assigning active monitors to devices, see Assigning active monitors.

For more information on setting up an action to fire based on the active monitor status, see Using Actions.