Database Management

How to Test SQL Sentry Target Connection

This article covers similar Windows and SQL Server connection methods SQL Sentry uses when adding a target.

First published date

4/11/2022 8:22 PM

Last published date

10/1/2025 4:47 PM

Overview

Run the tests mentioned in the resolution section using the Monitoring Service account to ensure the target is accessible from this SQL Sentry Client's location. These tests use connections like SQL Sentry and will validate the user's credentials, similar to how SQL Sentry does.

Product section

SQL Sentry (SQLS)

Cause

Failures to connect to the target can be due to environmental restrictions such as user permissions, firewalls, closed ports, or group policies.

Resolution

The following tests are done outside of our software to ensure that the Monitoring Service user can access the target from the location where it is being added. Perform all the noted connectivity tests using simple name, FQDN, and IP while logged in as the Monitoring Service account.

-- Scripts are not supported under any SolarWinds support program or service.
-- Scripts are provided AS IS without warranty of any kind. SolarWinds further
-- disclaims all warranties including, without limitation, any implied warranties
-- of merchantability or of fitness for a particular purpose. The risk arising
-- out of the use or performance of the scripts and documentation stays with you.
-- In no event shall SolarWinds or anyone else involved in the creation,
-- production, or delivery of the scripts be liable for any damages whatsoever
-- (including, without limitation, damages for loss of business profits, business
-- interruption, loss of business information, or other pecuniary loss) arising
-- out of the use of or inability to use the scripts or documentation.

Instance Connection Tests

  1. In SSMS, run SELECT SERVERPROPERTY('servername') to ensure the server name is correct.
  2. Use SSMS to test the connection to your target using the Monitoring Service account from the same location you are trying to add the target in the Client. If the Monitoring Service account can connect to the SQL target, it should bring back all the metrics for the SQL target within the Client. If you cannot connect, the Client won't be able to either. (This can also connect to SSAS targets, but you must change the Provider type.)
    • If SSMS is unavailable, a Universal Data Link (.UDL) file can be used to test the connection.
      • Enter the target information.
      • Select the login information for the Monitoring Service account.
      • Try to click the dropdown. If it allows you to select a server database, click the Test Connection button. (The dropdown is usually a good enough indicator that it can indeed connect since it has to bring back the connected databases, but it is always good to still click on that Test Connection button.)
      • UDLfile.jpg

OS/Windows Connection Tests

  1. Use the Registry Editor to check that the Windows registry can connect to the target using the Monitoring Service account from the same location you are trying to add the target in the Client. To run the Registry Editor as the Monitoring Service account, go to C:\WINDOWS to find the regedit.exe. Hold Shift and right-click to get the option to run as a different user.
    • Click File.
    • Then, Connect Network Registry...
    • Enter the target information and Check Names. If this succeeds, proceed to step 4.
    • Click OK. If the Monitoring Service account can connect to the target, it should retrieve all the folders within the Registry and their contents. (Expand a few folders to ensure no access denied issues.)
      • RegistryConnect.jpg
  2. Use the Event Viewer to check that the Windows side can connect to your target using the Monitoring Service account from the same location you are trying to add the target in the Client.
    • Right-click the Event Viewer (Local) root within the Event Viewer.
    • Click Connect to Another Computer.
    • Check the "Another computer" box and enter the target credentials.
    • Check the "Connect as another user: <none>" box and click the Set User button.
    • Enter the Monitoring Service account credentials and click OK. If the Monitoring Service account can connect to the target, it should retrieve all the folders within the Event Viewer and their contents. (Expand a few folders to ensure there are no access denied issues.)
      • EventViewerConnection.jpg
  3. Run the following PowerShell command to test connectivity.
    • <#
      Scripts are not supported under any SolarWinds support program or service.
      Scripts are provided AS IS without warranty of any kind. SolarWinds further
      disclaims all warranties including, without limitation, any implied warranties
      of merchantability or of fitness for a particular purpose. The risk arising
      out of the use or performance of the scripts and documentation stays with you.
      In no event shall SolarWinds or anyone else involved in the creation,
      production, or delivery of the scripts be liable for any damages whatsoever
      (including, without limitation, damages for loss of business profits, business
      interruption, loss of business information, or other pecuniary loss) arising
      out of the use of or inability to use the scripts or documentation.
      #> <# Replace the Credential and ComputerName placeholders with the Monitoring Service user and the target computer name. #> Get-WmiObject Win32_Service -Credential Domain\MSuser -ComputerName 123.456.7.8


      <# If it is a cluster, replace the ComputerName and Namespace placeholders in the following PowerShell
      and execute it from the Monitoring Service host as the service account. #>

      Get-WmiObject mscluster_resourcegroup -ComputerName Mynode -Namespace Root\MSCluster

      • It should provide a long string of items to which it can connect. Failures indicate issues reaching the target.
        PowerShellConnection.jpg
  4. Run a WBEMTEST on the server hosting the SQL Sentry Monitoring Service, while logged in as the service account. It is a built-in Windows tool that can be used to test connectivity to remote systems, validate WMI queries, and explore WMI.
    • Launch wbemtest.exe using a command prompt or the run command from the Start menu.
    • Click the Connect button to establish a connection to the remote server.
      • WbemTestConnect
    • Enter the name (in UNC format) for the target server, along with the root\cmv2 WMI class path of the target server, as shown here:
      • If local, use the following format: root\cimv2 or root\wmi
        • WbemTestLocal
      • If remote, use the following format: \\YourServerName\root\cimv2 or \\YourServerName\root\wmi. Replace the placeholder 'YourServerName' with the actual target name.
        • WbemTestRemote
      • If it is a cluster, use the following: \\YourServerName\root\mscluster and enable Packet privacy. Replace the placeholder 'YourServerName' with the actual target name.
        • WbemTestCluster
    • Click Query..., enter one of the below queries, click Apply, and validate the Query Results.
      • Please try connecting to and querying both the CIMV2 and WMI paths. Unfortunately, the WBEMTEST only takes one query at a time.WbemTestQuery
        • /*
          Scripts are not supported under any SolarWinds support program or service.
          Scripts are provided AS IS without warranty of any kind. SolarWinds further
          disclaims all warranties including, without limitation, any implied warranties
          of merchantability or of fitness for a particular purpose. The risk arising
          out of the use or performance of the scripts and documentation stays with you.
          In no event shall SolarWinds or anyone else involved in the creation,
          production, or delivery of the scripts be liable for any damages whatsoever
          (including, without limitation, damages for loss of business profits, business
          interruption, loss of business information, or other pecuniary loss) arising
          out of the use of or inability to use the scripts or documentation.
          */
          
          
          -- CIMV2 PATH: \\YourServerName\root\cimv2
          -- YourServerName is a placeholder for the target name.
          
          	SELECT * FROM Win32_ComputerSystem
          	SELECT * FROM Win32_Processor
          	SELECT * FROM Win32_OperatingSystem
          	SELECT * FROM Win32_PnPEntity
          	SELECT * FROM Win32_NetworkAdapter
          	SELECT * FROM Win32_NetworkAdapterConfiguration
          	SELECT * FROM Win32_ScsiController
          	SELECT * FROM Win32_IDEController
          	SELECT * FROM Win32_DiskDrive
          	SELECT * FROM Win32_DiskPartition
          	SELECT * FROM Win32_Service
          	SELECT * FROM Win32_USBController
          	SELECT * FROM Win32_Volume
          	SELECT * FROM CIM_DataFile
          	SELECT * FROM Win32_LogicalDisk WHERE DriveType=3
          /*
          Scripts are not supported under any SolarWinds support program or service.
          Scripts are provided AS IS without warranty of any kind. SolarWinds further
          disclaims all warranties including, without limitation, any implied warranties
          of merchantability or of fitness for a particular purpose. The risk arising
          out of the use or performance of the scripts and documentation stays with you.
          In no event shall SolarWinds or anyone else involved in the creation,
          production, or delivery of the scripts be liable for any damages whatsoever
          (including, without limitation, damages for loss of business profits, business
          interruption, loss of business information, or other pecuniary loss) arising
          out of the use of or inability to use the scripts or documentation.
          */
          
          
          -- WMI PATH: \\YourServerName\root\wmi
          -- YourServerName is a placeholder for the target name.
          
          	SELECT * FROM MSNdis_EnumerateAdapter
          	SELECT * FROM MSNdis_LinkSpeed

      • If it is a cluster, then run the following and turn on Packet privacy:

        • /*
          Scripts are not supported under any SolarWinds support program or service.
          Scripts are provided AS IS without warranty of any kind. SolarWinds further
          disclaims all warranties including, without limitation, any implied warranties
          of merchantability or of fitness for a particular purpose. The risk arising
          out of the use or performance of the scripts and documentation stays with you.
          In no event shall SolarWinds or anyone else involved in the creation,
          production, or delivery of the scripts be liable for any damages whatsoever
          (including, without limitation, damages for loss of business profits, business
          interruption, loss of business information, or other pecuniary loss) arising
          out of the use of or inability to use the scripts or documentation.
          */
          
          
          -- MsCluster PATH:   \\YourServerName\root\mscluster
          -- YourServerName is a placeholder for the target name.
          
          	SELECT * FROM MSCluster_Cluster
          	SELECT * FROM MSCluster_ClusterSharedVolume
          	SELECT * FROM MSCluster_Node


      If any tests fail, the Monitoring Service is blocked from accessing the target due to either permissions or a closed port. Below are links to the required SQL Sentry permissions and ports to access the target. Users should collaborate with their IT team to ensure that changes align with their organization's policies and procedures.