This commit is contained in:
Andras Bacsai 2022-12-09 13:59:43 +01:00
parent 967f42dd89
commit de9da8caf9

View File

@ -71,9 +71,9 @@ export async function showUsage(request: FastifyRequest) {
let { remoteEngine } = request.query
remoteEngine = remoteEngine === 'true' ? true : false
if (remoteEngine) {
const { stdout: stats } = await executeCommand({ sshCommand: true, shell: true, dockerId: id, command: `vmstat -s` })
const { stdout: stats } = await executeCommand({ sshCommand: true, dockerId: id, command: `vmstat -s` })
const { stdout: disks } = await executeCommand({ sshCommand: true, shell: true, dockerId: id, command: `df -m / --output=size,used,pcent|grep -v 'Used'| xargs` })
const { stdout: cpus } = await executeCommand({ sshCommand: true, shell: true, dockerId: id, command: `nproc --all` })
const { stdout: cpus } = await executeCommand({ sshCommand: true, dockerId: id, command: `nproc --all` })
const { stdout: cpuUsage } = await executeCommand({ sshCommand: true, shell: true, dockerId: id, command: `echo $[100-$(vmstat 1 2|tail -1|awk '{print $15}')]` })
const parsed: any = parseFromText(stats)
return {