diff --git a/src/psm/Util/Install/Installer.php b/src/psm/Util/Install/Installer.php index 010b9fbf..6ba3585c 100644 --- a/src/psm/Util/Install/Installer.php +++ b/src/psm/Util/Install/Installer.php @@ -239,6 +239,7 @@ class Installer `server_id` int(11) unsigned NOT NULL AUTO_INCREMENT, `ip` varchar(500) NOT NULL, `port` int(5) NOT NULL, + `protocol` enum('tcp','udp') NOT NULL default 'tcp', `request_method` varchar(50) NULL, `label` varchar(255) NOT NULL, `type` enum('ping','service','website') NOT NULL default 'service', diff --git a/src/psm/Util/Server/Updater/StatusUpdater.php b/src/psm/Util/Server/Updater/StatusUpdater.php index 24d37cd8..e9e56b26 100644 --- a/src/psm/Util/Server/Updater/StatusUpdater.php +++ b/src/psm/Util/Server/Updater/StatusUpdater.php @@ -92,7 +92,7 @@ class StatusUpdater $this->server = $this->db->selectRow(PSM_DB_PREFIX . 'servers', array( 'server_id' => $server_id, ), array( - 'server_id', 'ip', 'port', 'request_method', 'label', + 'server_id', 'ip', 'port', 'protocol', 'request_method', 'label', 'type', 'pattern', 'pattern_online', 'post_field', 'allow_http_status', 'redirect_check', 'header_name', 'header_value', 'status', 'active', 'warning_threshold', @@ -220,7 +220,7 @@ class StatusUpdater // save response time $starttime = microtime(true); - $fp = @fsockopen($this->server['ip'], $this->server['port'], $errno, $this->error, $timeout); + $fp = @fsockopen($this->server['protocol'] . '://' . $this->server['ip'], $this->server['port'], $errno, $this->error, $timeout); $status = ($fp === false) ? false : true; $this->rtime = (microtime(true) - $starttime);