SQL Query (Active)
- Last Updated: December 11, 2024
- 2 minute read
- WhatsUp Gold
- Version 2024
The SQL Query monitor uses Windows or ADO authentication to determine if specific conditions exist in a Microsoft SQL, MySQL, or ORACLE database by querying the database. If the configured conditions are present, the monitor is Up. If changes made to the database since the last query cause data to no longer fall within the defined criteria, the monitor is Down.
Provide a unique name and description for the monitor, then configure the following:
- Server Type. Select Microsoft SQL Server, MySQL, or ORACLE as the database server type. Please note, MySQL database is supported and listed as a server type option only if the MySQL 5.2.5 Connector is installed.
- Connection Timeout. Enter the amount of time WhatsUp Gold waits for the server to respond before terminating the connection and returning the timeout error. The minimum allowed value is 1 second whereas maximum allowed value is 120. Please note, this setting only applies to polling whereas the query builder assumes a default of 15 seconds for the connection timeout.
- Server Address. Enter the server address in the applicable format:
- ServerName\Instance format for Microsoft SQL Server. Example: WUGServer\SQLEXPRESS
- ServerName for MySQL. Example: WUGServer
- ServerName/ServiceName for Oracle. Example: WUGServer/Oracle.
- Port. Enter the database server port number.
- SQL Query to Run. Type in a query to run against the specified database to check for certain database conditions.Tip: When using MS SQL, begin your query with a SELECT statement that uses full namespace notation to identify the database. For example:
SELECT *FROM WhatsUp.dbo.Device
Click Build to launch the SQL Query Builder for assistance with developing proper query syntax. Only SELECT queries are allowed.
Click Verify to test if the entered database query is valid.
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. All database rows must match the criteria settings for the monitor to be considered Up.
Content of each retrieved row matches the following criteria. Select this option to determine the success or failure of the monitor scan based on criteria each database row must match. If multiple threshold criteria are used, all thresholds must match the criteria in each row for the monitor to be considered Up.
Click Add, Edit, and Delete as needed to create, modify, and remove database column values and conditions, respectively.