Source Server Status via webpage

Soldato
Joined
4 Dec 2002
Posts
4,011
Location
Bourne, Lincs
I am writing a web page to list the status of my source servers, and I am trying to find a way to put some code on the webpage that will check if the server is up or not, and return a icon depending on if it is up or down

Does anyone know how to do this?

Kimbie
 
Wrong section, but ...

PHP:
<?php

$open = @fsockopen( "[server ip]", "[server port]", $ERRNO, $ERRSTR, 0.5 );

if( !$open ) {
	echo "Offline";
} else {
	echo "Online";
}

?>
 
Back
Top Bottom