Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

ping SQL Server instance? Expand / Collapse
Author
Message
Posted Friday, April 11, 2008 3:20 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, December 2, 2010 6:48 PM
Points: 7, Visits: 39
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.
Post #483983
Posted Friday, April 11, 2008 3:40 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 9:59 AM
Points: 5,314, Visits: 9,724
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
Post #483991
Posted Friday, April 11, 2008 3:49 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, November 12, 2013 8:44 AM
Points: 1,073, Visits: 6,334
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

Post #483993
Posted Friday, April 11, 2008 11:52 PM


Keeper of the Duck

Keeper of the Duck

Group: Moderators
Last Login: Monday, August 18, 2014 8:24 AM
Points: 6,634, Visits: 1,871
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, CISA, MCSE, Security+, MVP - SQL Server
Regular Columnist (Security), SQLServerCentral.com
Author of Introduction to SQL Server: Basic Skills for Any SQL Server User
| Professional Development blog | Technical Blog | LinkedIn | Twitter
Post #484037
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse