From 78a57c2bd620e8e7611f24efc9f26ea6e57e2015 Mon Sep 17 00:00:00 2001 From: Ben Allfree Date: Thu, 5 Sep 2024 18:45:08 +0000 Subject: [PATCH] Open file check --- .../src/cli/commands/HealthCommand/checkHealth.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/pockethost/src/cli/commands/HealthCommand/checkHealth.ts b/packages/pockethost/src/cli/commands/HealthCommand/checkHealth.ts index 98558851..05fa4cdb 100644 --- a/packages/pockethost/src/cli/commands/HealthCommand/checkHealth.ts +++ b/packages/pockethost/src/cli/commands/HealthCommand/checkHealth.ts @@ -30,8 +30,6 @@ export const checkHealth = async () => { .toString() .split(`\n`) - const openFiles = _exec(`lsof -n | awk '$4 ~ /^[0-9]/ {print}'`) - type DockerPs = { Command: string CreatedAt: string @@ -153,6 +151,8 @@ export const checkHealth = async () => { ), ) + const openFiles = _exec(`cat /proc/sys/fs/file-nr`)[0]?.trim() || `Unknown` + await send([ `===================`, `Server: SFO-1`, @@ -164,7 +164,7 @@ export const checkHealth = async () => { `Free Storage /mnt/pockethost: ${ (await drive.info(`/mnt/pockethost`)).freeGb }GB`, - `Open files: ${openFiles.length}`, + `Open files: ${openFiles}`, `Containers: ${containers.length}`, ])