mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 05:56:16 +00:00
remote monitor (#167)
This commit is contained in:
@ -166,4 +166,21 @@ public function cleanup(): void
|
||||
'cleanup'
|
||||
);
|
||||
}
|
||||
|
||||
public function resourceInfo(): array
|
||||
{
|
||||
$info = $this->server->ssh()->exec(
|
||||
$this->getScript('resource-info.sh'),
|
||||
);
|
||||
|
||||
return [
|
||||
'load' => str($info)->after('load:')->before(PHP_EOL)->toString(),
|
||||
'memory_total' => str($info)->after('memory_total:')->before(PHP_EOL)->toString(),
|
||||
'memory_used' => str($info)->after('memory_used:')->before(PHP_EOL)->toString(),
|
||||
'memory_free' => str($info)->after('memory_free:')->before(PHP_EOL)->toString(),
|
||||
'disk_total' => str($info)->after('disk_total:')->before(PHP_EOL)->toString(),
|
||||
'disk_used' => str($info)->after('disk_used:')->before(PHP_EOL)->toString(),
|
||||
'disk_free' => str($info)->after('disk_free:')->before(PHP_EOL)->toString(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user