CC-3409: System status page times out if monit is not running.
-Fixed
This commit is contained in:
parent
4cb64b0eb1
commit
edcce7432d
1 changed files with 8 additions and 4 deletions
|
@ -11,14 +11,18 @@ class Application_Model_Systemstatus
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||||
curl_setopt($ch, CURLOPT_URL, $url);
|
curl_setopt($ch, CURLOPT_URL, $url);
|
||||||
curl_setopt($ch, CURLOPT_USERPWD, "guest:airtime");
|
curl_setopt($ch, CURLOPT_USERPWD, "guest:airtime");
|
||||||
|
//wait a max of 3 seconds before aborting connection attempt
|
||||||
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
|
||||||
$result = curl_exec($ch);
|
$result = curl_exec($ch);
|
||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
|
|
||||||
$docRoot = null;
|
$docRoot = null;
|
||||||
if ($result != ""){
|
if ($result != FALSE){
|
||||||
$xmlDoc = new DOMDocument();
|
if ($result != ""){
|
||||||
$xmlDoc->loadXML($result);
|
$xmlDoc = new DOMDocument();
|
||||||
$docRoot = $xmlDoc->documentElement;
|
$xmlDoc->loadXML($result);
|
||||||
|
$docRoot = $xmlDoc->documentElement;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $docRoot;
|
return $docRoot;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue