socialnerds/hive
socialnerds
/
hive
Archived
1
0
Fork 0

couple of changes to start with

This commit is contained in:
David 2012-05-21 00:45:17 +02:00
parent 27b90c35dc
commit 40b64def61
2 changed files with 7 additions and 1 deletions

View File

@ -28,9 +28,12 @@ class diskmon(object):
#getting block infos
if os.path.ismount(part["mountpoint"]):
fs = os.statvfs(part["mountpoint"])
part["mounted"] = "1" #mounted flag
part["blocksize"] = fs.f_bsize #blocksize
part["total blocks"] = fs.f_blocks #total blocks
part["free blocks"] = fs.f_bavail #free blocks
part["used blocks"] = part["total blocks"] - part["free blocks"]
part["files"] = fs.f_files #total files
break
mtab.close()

View File

@ -14,7 +14,7 @@ def bytes2human(bytes):
return human
def blocks2bytes(blocks, blocksize):
bytes = float(blocks) * float(blocksize)
bytes = float(blocks) * float(blocksize) / 1024
return bytes
@ -34,4 +34,7 @@ if __name__ == "__main__":
else:
print "\n"
print "debug output"
print diskmoninstance.partitions
#end of file