May 13, 2011 at 7:57 am
Hi guys, is there a way to check if a server is accessible? I have an issue with a particular server where it goes offline and back online randomly based on traffic and networking issues, is there a way either through C#, vb 2008 or any other method that will allow me to check to see if the server is online and accessible?
May 13, 2011 at 8:39 am
I use a ping from a reporting server, it alerts me if a ping fails.
You can query the service using a linked server but linked server queires can sometime be difficult if the target isn't there!
SQL Diagnostic Manager will notify you if the service is unavailable.
It depends upon the exact issue you're getting - ping is about the safest and easiest,
[font="Comic Sans MS"]The GrumpyOldDBA[/font]
www.grumpyolddba.co.uk
http://sqlblogcasts.com/blogs/grumpyolddba/
May 13, 2011 at 8:49 am
schedule a job with email on another SQL Server
exec xp_cmdshell 'ping serverip\servername'
if you not get the ping then email to you otherwise not,I might be schedule on OS level also I think so
Regards,
Syed Jahanzaib Bin Hassan
BSCS | MCTS | MCITP | OCA | OCP | OCE | SCJP | IBMCDBA
My Blog
www.aureus-salah.com
May 13, 2011 at 8:50 am
You think its possible for me to add that into SSIS or just create a whole new step in an agent job? I'll look up the diagnostic manager now because this network issue should not be happening, its just that the network here is awful. A lot of downtime sometimes.
May 13, 2011 at 8:52 am
can create SSIS as well and whole code can be in a single agent job
Regards,
Syed Jahanzaib Bin Hassan
BSCS | MCTS | MCITP | OCA | OCP | OCE | SCJP | IBMCDBA
My Blog
www.aureus-salah.com
May 13, 2011 at 8:52 am
Ok Syed, I was just about to ask about that because I remember seeing something like that a while ago. I'll look into it now, do I need to have the server IP and servername or is it possible to just ping the server?
May 13, 2011 at 8:54 am
you need any 1 of them SERVER IP or is there DNS in your organization then SERVER NAME can use also
IP is best
Regards,
Syed Jahanzaib Bin Hassan
BSCS | MCTS | MCITP | OCA | OCP | OCE | SCJP | IBMCDBA
My Blog
www.aureus-salah.com
May 13, 2011 at 8:57 am
Thanks syed, I have the IP of the server, I will just set up another step in the job where if the step succeeds then continue with the job and if not just kick out a fail email. I would do it in the package but if I were to do it in the package and the access is not available the package will run and fail because of the connection not available, instead of having the package run, I think its better to do what you said which is to just add a step and ping the server. I'll try it out and let you know the results in a few mins.
May 13, 2011 at 8:58 am
if you want to either mail me direct or send me a message I'll send you the code I use to ping servers - you can't just issue xp_cmdshell 'ping xxx'
I have a job which runs every 5 mins, but it could run every minute, which checks connectivity across all my servers, some of which connect by vpn - hence my interest. This runs from within the data centre as against Diagnostic Manager which runs locally - data centre is not at offices so i need to know if we lose connectivity.
[font="Comic Sans MS"]The GrumpyOldDBA[/font]
www.grumpyolddba.co.uk
http://sqlblogcasts.com/blogs/grumpyolddba/
May 13, 2011 at 9:10 am
Thanks for your help Syed, what you suggested as far as the ping worked, I also had an issue running the xp_cmdshell command on the server because it wasn't activated, below I have pasted the code that I used that worked in activating it and allowing me to run the command. Hope that helps anyone that might need that kind of information.
EXEC sp_configure 'show advanced options', 1
GO
RECONFIGURE WITH OVERRIDE
EXEC sp_configure'xp_cmdshell', 1
go
RECONFIGURE WITH OVERRIDE
May 13, 2011 at 9:11 am
hey colin, that would be great if you could send me that code. I would be most appreciative. Would you rather email it to me or post it in the forum as an attachment?
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply