954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

server uptime application

anyone can help mo to tell the algorithm how to make server uptime application like serveruptime.com?

http://www.duniaislam.site50.net

forzadraco
Junior Poster in Training
70 posts since Mar 2008
Reputation Points: 10
Solved Threads: 1
 

Hi Darco,

I assume you're after the PHP function you'd use for checking whether a server is up (the rest will just be a database of the sites you're monitoring).

Personally, I'd probably about it with a socket_connect call, that should be able to confirm a connection existing to an address, which I guess is all you are looking to confirm.

BeachyUK
Light Poster
38 posts since May 2006
Reputation Points: 10
Solved Threads: 1
 

Actually, thinking it through, perhaps I'd go with something more like this... If you wanted to, you could read the contents of the URL, though I imagine you just want an UP or DOWN decision, I think the below would do the trick.

$cn = fsockopen ('http://www.daniweb.com', 443, $errnum, $errdesc, 30);

if (!$cn) {
// Can't Connect to URL
$sitestatus="DOWN";
}else{
// Connected fine - URL works
$sitestatus="UP";
}
BeachyUK
Light Poster
38 posts since May 2006
Reputation Points: 10
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You