forked from Sysdeploy/idlers-agent
disk space calculation using /sys/block/
This commit is contained in:
parent
5b61f38715
commit
aa577a0d02
4
agent.py
4
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'):
|
||||
|
|
Loading…
Reference in New Issue
Block a user