Use this Knowledge Script to monitor SQL Server connectivity. You can set a timeout to determine the number of times the script should attempt to contact the server.
This script raises an event if, during any monitoring interval, the number of times the server is not available exceeds the number of retries you specify.
NOTE:To run this Knowledge Script, you need public and read-only SQL Server permission.
SQL Server instance
The default interval for this script is Every five minutes.
Set the following parameters as needed:
Description |
How to Set It |
---|---|
General Settings |
|
Job Failure Notification |
|
Raise event if job fails unexpectedly? |
Select Yes to raise an event if the SQLServer_Connectivity job fails unexpectedly. The default is Yes. |
Event severity when job fails unexpectedly |
Set the event severity level, from 1 to 40, to indicate the importance of an event that is raised when the job fails unexpectedly. The default is 5. |
Additional Settings |
|
Event Details |
|
Event detail format |
Select the format in which you want to display the event detail. You can select from HTML Table or Plain Text. The default is HTML Table. |
Authentication |
Select the authentication method that you want to use to access SQL Server. You can either select Windows Authentication or SQL Server Authentication. The default is Windows Authentication. |
User name |
Specify the Windows or SQL Server user name that you want to use to access SQL Server. You can specify multiple users separated by a comma. The default is none. For more information on specifying user name, see Specifying the User Name in the Knowledge Script in the Management Guide. For more information on specifying user name, see Section 2.7.3, Specifying the User Name in the Knowledge Script. |
Monitor Server Connectivity |
|
Timeout |
Specify the maximum number of seconds the Connectivity script should wait for a response from server before retrying. The default is 30 seconds. |
Number of retries |
Specify the number of times the Connectivity script must retry connecting to the SQL Server before determining that the server is inaccessible. The default is 0. |
Event Notification |
|
Raise event if connection with SQL server fails? |
Select Yes to raise an event if the connection to a server or an instance fails. The default is Yes. |
Event severity when connection with SQL server fails |
Set the event severity level, from 1 to 40, to indicate the importance of an event in which the connection with a server fails. The default is 5. |
Data Collection |
|
Collect data for server connectivity? |
Select Yes to collect server connectivity data for charts and reports. The default is unselected. |
Custom data stream legend |
Specify a custom data stream legend to append with the default data legend for the job that is visible in the console. You can specify a maximum of 128 alphanumeric characters in a string, including special characters. The default is none. |