Useage: echo $PAGE ?>?host=<hostname>&port=<port>[&verbose][&timeout=<seconds>][&download] Server: Hostname or IP address Port: Port to attempt connection to Verbose: Enable detailed textual display Timeout: Seconds for socket timeout Download: Ignore other input and download source of script} function checkServer(){ global $host, $port, $timeout, $image, $status, $handle, $errno, $errstr; $handle=@fsockopen($host, $port, $errno, $errstr, $timeout); if (!$handle){ @fclose($handle); switch ($errno){ case 0: case 8: case 113: $image = "error"; $status= "DNS/Route Error"; break; case 10060: case 111: $image = "down"; $status= "Connection Refused"; break; case 110: $image = "time"; $status= "Socket Timeout"; break; default: $image = "what"; $status= "Unknown, please report status to obive.net to get added to script"; } }else { //looks like we opened a socket! its probably up! @fclose($handle); $image = "up"; } $image .= ".png"; } if (isset($_GET['download'])){ sendFile($PAGE); die(); } $host = $_GET['host']; $port = $_GET['port']; if (!isset($_GET['verbose'])){ if (!isset($_GET['host']) || !isset($_GET['port'])){ printUsage(); }else{ checkServer(); sendImage($image); } }else{ ?>
Host:
Port:
Timeout: 1 ) ? " seconds" : " second")); ?>
Resolved IP address:
Reverse name lookup:
Service:
Handle:
Error Number:
Error String:
Result:
Result Time: ms
FileName:Script by: Charlie Hayes
Image:![]()