[Web] Add JVM memory indiator and add minor fixes
This commit is contained in:
@@ -1574,16 +1574,34 @@ function solr_status() {
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($curl, CURLOPT_POST, 0);
|
||||
curl_setopt($curl, CURLOPT_TIMEOUT, 20);
|
||||
$response = curl_exec($curl);
|
||||
if ($response === false) {
|
||||
curl_setopt($curl, CURLOPT_TIMEOUT, 10);
|
||||
$response_core = curl_exec($curl);
|
||||
if ($response_core === false) {
|
||||
$err = curl_error($curl);
|
||||
curl_close($curl);
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
curl_close($curl);
|
||||
$status = json_decode($response, true);
|
||||
$curl = curl_init();
|
||||
$status_core = json_decode($response_core, true);
|
||||
$url = 'http://solr:8983/solr/admin/info/system';
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($curl, CURLOPT_POST, 0);
|
||||
curl_setopt($curl, CURLOPT_TIMEOUT, 10);
|
||||
$response_sysinfo = curl_exec($curl);
|
||||
if ($response_sysinfo === false) {
|
||||
$err = curl_error($curl);
|
||||
curl_close($curl);
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
curl_close($curl);
|
||||
$status_sysinfo = json_decode($response_sysinfo, true);
|
||||
$status = array_merge($status_core, $status_sysinfo);
|
||||
return (!empty($status['status']['dovecot-fts']) && !empty($status['jvm']['memory'])) ? $status : false;
|
||||
}
|
||||
return (!empty($status['status']['dovecot-fts'])) ? $status['status']['dovecot-fts'] : false;
|
||||
}
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user