Skip to content

Commit

Permalink
Merge pull request #66 from Mephetran/CPCLOUD-2690-360-monitoring-sho…
Browse files Browse the repository at this point in the history
…ws-0-memory

[CPCLOUD-2690] 360 Monitoring shows 0 memory
  • Loading branch information
ktak-007 authored Sep 29, 2023
2 parents 2470e03 + 7d81af1 commit e9dbdb0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion agent360/plugins/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e9dbdb0

Please sign in to comment.