';
//configure script
$timeout = "1";
//set service checks
/*
The script will open a socket to the following service to test for connection.
Does not test the fucntionality, just the ability to connect
Each service can have a name, port and the Unix domain it run on (default to localhost)
*/
$services = array();
$services[] = array("port" => "80", "service" => "Nginx", "ip" => "") ;
$services[] = array("port" => "5222", "service" => "Prosody", "ip" => "") ;
$services[] = array("port" => "5281", "service" => "Веб-сервер Prosody", "ip" => "") ;
$services[] = array("port" => "25", "service" => "Postfix", "ip" => "") ;
$services[] = array("port" => "143", "service" => "Dovecot", "ip" => "") ;
$services[] = array("port" => "1323", "service" => "Alps", "ip" => "") ;
$services[] = array("port" => "5232", "service" => "Radicale", "ip" => "") ;
$services[] = array("port" => "80", "service" => "Yandex", "ip" => "ya.ru") ;
//begin table for status
$data .= "
Название | Порт | Состояние |
";
foreach ($services as $service) {
if($service['ip']==""){
$service['ip'] = "localhost";
}
$data .= "" . $service['service'] . " | ". $service['port'];
$fp = @fsockopen($service['ip'], $service['port'], $errno, $errstr, $timeout);
if (!$fp) {
$data .= " | Не работает |
";
//fclose($fp);
} else {
$data .= "Работает | ";
fclose($fp);
}
}
//close table
$data .= "
";
$data .= '
';
echo $data;
/* =====================================================================
//
// ////////////////// SERVER INFORMATION /////////////////////////////////
//
//
* =======================================================================/*/
$data1 = "";
$data1 .= '