SQLServerCentral.com / Article Discussions by Author / Article Discussions / Discuss content posted by Mahidhar Vattem / To Ping SQL Servers / Latest PostsInstantForum.NET v99.99.99SQLServerCentral.comhttp://www.sqlservercentral.com/Forums/notifications@sqlservercentral.comFri, 09 Dec 2016 09:17:08 GMT20RE: To Ping SQL Servershttp://www.sqlservercentral.com/Forums/Topic634017-1409-1.aspxGood tip. Thanks,We can have a utility that parses the output file looking for the text - 100% loss.That indicates that a server is not responding and if so take appropriate action. Wed, 04 Feb 2009 16:30:45 GMTMohamed-401375RE: To Ping SQL Servershttp://www.sqlservercentral.com/Forums/Topic634017-1409-1.aspxThese are great thanks to all. We run on a clustered server. Anyone know how to set an alert to determine when the SLQ has failed over to the other node?Fri, 16 Jan 2009 09:28:31 GMTdhermanRE: To Ping SQL Servershttp://www.sqlservercentral.com/Forums/Topic634017-1409-1.aspxDavid that's great! I'll give it a try as well.:w00t:Fri, 16 Jan 2009 06:16:46 GMTliebesiechRE: To Ping SQL Servershttp://www.sqlservercentral.com/Forums/Topic634017-1409-1.aspxWe have serveral servers, both SQL Servers and others. Since SQL Server, especially 2005 and newer, do email so well I have [b]two [/b]of my SQL Servers, so if one is down the other still functions, read a list of servers from a table and ping them. If they don't respond I read from a list of people from a table and email them.-- Pings servers listed in a table, if no contact emails peopleDeclare @ServerName as nchar(20), @EmailPerson nchar(40), @result int, @CmdTxt varchar(100), @Comment varchar(1000)DECLARE Servers CURSOR FORSELECT ServerName FROM dba..ServersToPing ORDER BY ServerNameOPEN ServersFETCH NEXT FROM Servers into @ServerNameWHILE @@FETCH_STATUS = 0BEGIN set @CmdTxt = 'ping ' + ltrim(rtrim(@ServerName)) EXEC @result = xp_cmdshell @CmdTxt, no_output IF (@result = 1) begin Set @Comment = 'Server ' + char(34) + ltrim(rtrim(@ServerName)) + char(34) + ' - Contact failure, possibly not running' Print @Comment declare EmailList cursor for select EmailAddress from dba..EmailAddresses open EmailList fetch next from EmailList into @EmailPerson WHILE @@FETCH_STATUS = 0 BEGIN -- Be sure and make sure the appropriate profile_name is used for -- server this code is being run on. EXEC msdb.dbo.sp_send_dbmail @profile_name = 'in-mslc-sql3 mail', @recipients = @EmailPerson, @body = @Comment, @subject = @Comment fetch next from EmailList into @EmailPerson end CLOSE EmailList DEALLOCATE EmailList end FETCH NEXT FROM Servers into @ServerNameENDCLOSE ServersDEALLOCATE ServersGOFri, 16 Jan 2009 05:45:24 GMTDavid ChanceRE: To Ping SQL Servershttp://www.sqlservercentral.com/Forums/Topic634017-1409-1.aspxActually a good and simple way to check if your servers are still reachable as part of your daily DBA routine or if somebody reports a problem.:PFri, 16 Jan 2009 02:51:07 GMTliebesiechTo Ping SQL Servershttp://www.sqlservercentral.com/Forums/Topic634017-1409-1.aspxComments posted to this topic are about the item [B]<A HREF="/scripts/ping/65443/">To Ping SQL Servers</A>[/B]Fri, 09 Jan 2009 17:33:46 GMTHotfix