Skip to content

Commit 9757f72

Browse files
committed
Merge pull request #47 from c-eller/development
Update diskspace.py
2 parents dd051b7 + ed98e8c commit 9757f72

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

miniprobe/sensors/diskspace.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,31 +83,31 @@ def get_data(data, out_queue):
8383
def read_disk(self):
8484
disks = []
8585
channel_list = []
86-
for line in os.popen("df -k"):
87-
if line.startswith("/"):
86+
for line in os.popen("df -k -xtmpfs -xdevtmpfs"):
87+
if not line.startswith("Filesystem"):
8888
disks.append(line.rstrip().split())
8989
for line in disks:
90-
channel1 = {"name": "Total Bytes " + str(line[0]),
90+
channel1 = {"name": "Total Bytes " + str(line[5]),
9191
"mode": "integer",
9292
"kind": "BytesDisk",
9393
"value": int(line[1]) * 1024}
94-
channel2 = {"name": "Used Bytes" + str(line[0]),
94+
channel2 = {"name": "Used Bytes " + str(line[5]),
9595
"mode": "integer",
9696
"kind": "BytesDisk",
9797
"value": int(line[2]) * 1024}
98-
channel3 = {"name": "Free Bytes " + str(line[0]),
98+
channel3 = {"name": "Free Bytes " + str(line[5]),
9999
"mode": "integer",
100100
"kind": "BytesDisk",
101101
"value": int(line[3]) * 1024}
102102
total = float(line[2]) + float(line[3])
103103
used = float(line[2]) / total
104104
free = float(line[3]) / total
105105

106-
channel4 = {"name": "Free Space " + str(line[0]),
106+
channel4 = {"name": "Free Space " + str(line[5]),
107107
"mode": "float",
108108
"kind": "Percent",
109109
"value": free * 100}
110-
channel5 = {"name": "Used Space" + str(line[0]),
110+
channel5 = {"name": "Used Space " + str(line[5]),
111111
"mode": "float",
112112
"kind": "Percent",
113113
"value": used * 100}

0 commit comments

Comments
 (0)