From 7d81af1e043170ffb9fa0b1fda8a2935ac2f0174 Mon Sep 17 00:00:00 2001 From: Mikhail Shport Date: Tue, 5 Sep 2023 10:55:10 +0300 Subject: [PATCH] [CPCLOUD-2690] 360 Monitoring shows 0 memory --- agent360/plugins/memory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent360/plugins/memory.py b/agent360/plugins/memory.py index 443b0e2..9388c1a 100755 --- a/agent360/plugins/memory.py +++ b/agent360/plugins/memory.py @@ -15,7 +15,7 @@ def run(self, *unused): memory[name] = getattr(mem, name) if (memory['available'] == 0 or memory['buffers'] == 0) and os.name != 'nt': - tot_m, used_m, free_m, sha_m, buf_m, cac_m, ava_m = map(int, os.popen('free -b -w').readlines()[1].split()[1:]) + tot_m, used_m, free_m, sha_m, buf_m, cac_m, ava_m = map(int, os.popen('free -b -w').readlines()[1].split(':', 1)[1].split()) memory['percent'] = 100-(((free_m+buf_m+cac_m)*100)/tot_m) memory['available'] = ava_m memory['buffers'] = buf_m