[BUG] Fail in service monitoring for IPv6 #881
This commit is contained in:
parent
ee16078884
commit
4944d61839
|
@ -225,7 +225,11 @@ class StatusUpdater
|
|||
// save response time
|
||||
$starttime = microtime(true);
|
||||
|
||||
$fp = @fsockopen($this->server['ip'], $this->server['port'], $errno, $this->error, $timeout);
|
||||
$serverIp = $this->server['ip'];
|
||||
if (filter_var($serverIp,FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) !== false){
|
||||
$serverIp = "[$serverIp]";
|
||||
}
|
||||
$fp = @fsockopen($serverIp, $this->server['port'], $errno, $this->error, $timeout);
|
||||
|
||||
$status = ($fp === false) ? false : true;
|
||||
$this->rtime = (microtime(true) - $starttime);
|
||||
|
|
Loading…
Reference in New Issue