Prueba haber que tal
Código PHP:
Ver originalfunction check($ip, $port)
{
$file = fsockopen($ip, $port, $errno, $errstr, 2); $status = 0;
if(!$file) $status = -1; // Site is down
else
{
$status = ($stoptime - $starttime) * 1000;
$status = floor($status); }
return $status;
}
if(check("IP", "PUERTO") != -1)
{
echo "online";
}
else
{
echo "offline";
}