protocol implementation
added protocol field to SQL & StatusUpdater.
This commit is contained in:
parent
6ba4b59239
commit
31058ba18b
|
@ -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',
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue