Click to See Complete Forum and Search --> : Webserver down notification
amitg
November 17th, 2003, 09:39 AM
Hi
I want to develop an application that remotely notifies me when a webserver is down. Can you please help me out?
Thanks
Amit
Apoch
November 17th, 2003, 10:02 AM
Try opening a TCP connection between the server and the client (doesn't matter what port, you may even have to write a simple TCP server app to keep the connection from getting dropped). When the connection goes down, you know the web server is "down," and you can then send a notification to yourself however you like.
amitg
November 17th, 2003, 10:04 AM
Thanks for the reply.
How can I do that without developing any serverside component?
Apoch
November 17th, 2003, 10:12 AM
If your web server supports persistent connections, just open a connection on port 80 and never make a request. However, it may drop the connection randomly, so that's not always reliable. You could make a request like GET / HTTP/1.0 every few seconds and ignore the return, but you still may have random drop problems.
The next best bet is to send the server a ping every few seconds and look for packet loss. Have a look at WFC's CPing class (http://www.codeproject.com/library/wfc.asp).
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.