SQL Query (Active)
- Last Updated: June 21, 2023
- 3 minute read
- WhatsUp Gold
The SQL Query monitor uses WMI 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.
If you would like to begin monitoring MySQL 5.6/5.7 using this version of WhatsUp Gold, you’ll first need to download the v5.2.5 connector in .zip archive format here. After accessing the MySQL Product Archives URL, select 5.2.5 as the Product Version and .NET & Mono as the Operating System from the applicable drop-down menus, then click Download. Extract the MySql.data.dll file from the downloaded .zip package, then copy it into the following two locations inside the WhatsUp Gold installation folder:
C:\Program Files (x86)\Ipswitch\WhatsUp\
C:\Program Files (x86)\Ipswitch\WhatsUp\html\NM.UI\bin\extensions\WUG\
Please note, the file paths displayed here represent the default locations used by the installation program. If you have WhatsUp Gold installed in a different location, copy the .dll file into the corresponding folders on your server.
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.