ping SQL Server instance?

  • Hi there,

    I have about 25 SQL Server instances in my company.

    I am looking to write (or acquire) a monitoring script that can be run from a central server to 'ping' each of the instances to make sure they are up and running. If any instance is down, to send me an email.

    It's easy enough to create a script to run locally and just check if the service is running or not, but it seems a bit harder to check remotely.

    Is there an equivalent of the Oracle TNSPING command for SQL Server?

    Thanks.

  • I believe there's a utility called sqlping, but anyhow, if you search for "ping" in Books Online, you'll probably find what you're looking for.

    John

  • A good way to get an indication of whether the server is running and accepting connections is to just run a query against the master database from within your script. A response means it's 'up', otherwise 'down'.

    For example:

    SELECT TOP 1 message_id FROM sys.messages

  • Or simple SELECT @@SERVERNAME, which you can use to verify you are connected to the SQL Server you think you should be connecting to.

    K. Brian Kelley
    @kbriankelley

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply