SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


ping SQL Server instance?


ping SQL Server instance?

Author
Message
EVCCDBA
EVCCDBA
SSC Rookie
SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)

Group: General Forum Members
Points: 37 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.
John Mitchell-245523
John Mitchell-245523
SSC-Dedicated
SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)

Group: General Forum Members
Points: 34739 Visits: 16661
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
Todd Engen
Todd Engen
SSCrazy
SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)

Group: General Forum Members
Points: 2797 Visits: 6336
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
K. Brian Kelley
K. Brian Kelley
Keeper of the Duck
Keeper of the Duck (24K reputation)

Group: Moderators
Points: 24898 Visits: 1917
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search