|
|
|
@ -97,6 +97,8 @@ class Container extends CPHPDatabaseRecordClass
|
|
|
|
|
return $this->sStatus;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
$command = array("vzctl", "status", $this->sInternalId);
|
|
|
|
|
|
|
|
|
@ -116,6 +118,11 @@ class Container extends CPHPDatabaseRecordClass
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (SshCommandException $e)
|
|
|
|
|
{
|
|
|
|
|
return CVM_STATUS_STOPPED;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function GetStatusText()
|
|
|
|
@ -153,6 +160,8 @@ class Container extends CPHPDatabaseRecordClass
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function GetRam()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
$result = $this->RunCommandCached("free -m", true);
|
|
|
|
|
$lines = explode("\n", $result->stdout);
|
|
|
|
@ -175,6 +184,13 @@ class Container extends CPHPDatabaseRecordClass
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (SshCommandException $e)
|
|
|
|
|
{
|
|
|
|
|
$total_free = 0;
|
|
|
|
|
$total_used = 0;
|
|
|
|
|
$total_total = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return array(
|
|
|
|
|
'free' => $total_free,
|
|
|
|
@ -196,6 +212,8 @@ class Container extends CPHPDatabaseRecordClass
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function GetDisk()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
$result = $this->RunCommandCached("df -l -x tmpfs", true);
|
|
|
|
|
$lines = explode("\n", $result->stdout);
|
|
|
|
@ -217,6 +235,13 @@ class Container extends CPHPDatabaseRecordClass
|
|
|
|
|
$total_total += ((int)$values[2] + (int)$values[3]) / 1024;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (SshCommandException $e)
|
|
|
|
|
{
|
|
|
|
|
$total_free = 0;
|
|
|
|
|
$total_used = 0;
|
|
|
|
|
$total_total = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return array(
|
|
|
|
|
'free' => $total_free,
|
|
|
|
|