From aa577a0d023fdeeba758735f05f7f9bd025a2963 Mon Sep 17 00:00:00 2001 From: Shailaja Date: Tue, 25 Jun 2024 17:42:42 +0530 Subject: [PATCH] disk space calculation using /sys/block/ --- agent.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agent.py b/agent.py index 90f6895..1f0597c 100644 --- a/agent.py +++ b/agent.py @@ -27,12 +27,12 @@ class ServerData: self.public_ip = self.get_public_ip() logging.basicConfig(level=logging.INFO) -def get_ram_and_disk(self): + def get_ram_and_disk(self): # RAM information with open('/proc/meminfo', 'r') as f: meminfo = f.read() ram = int([x for x in meminfo.split('\n') if 'MemTotal' in x][0].split()[1]) // 1024 - + # Disk space information disk = 0 for device in os.listdir('/sys/block'):