From ed40db94f508290d35867736910830d7f837b050 Mon Sep 17 00:00:00 2001 From: st_koegel Date: Wed, 31 Jan 2018 12:34:34 +0100 Subject: [PATCH] remove first line from output instead of checking through string matching --- miniprobe/sensors/diskspace.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/miniprobe/sensors/diskspace.py b/miniprobe/sensors/diskspace.py index ed6469f..86a0b9d 100644 --- a/miniprobe/sensors/diskspace.py +++ b/miniprobe/sensors/diskspace.py @@ -83,9 +83,8 @@ def get_data(data, out_queue): def read_disk(self): disks = [] channel_list = [] - for line in os.popen("df -k -xtmpfs -xdevtmpfs"): - if not line.startswith("Filesystem"): - disks.append(line.rstrip().split()) + for line in os.popen("df -k -xtmpfs -xdevtmpfs | sed '1d'"): + disks.append(line.rstrip().split()) for line in disks: channel1 = {"name": "Total Bytes " + str(line[5]), "mode": "integer",