From 6fa7f9d78907b5984340178e9ed96406e2b0802f Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Thu, 3 Nov 2016 19:44:11 +0100 Subject: [PATCH] [modules/disk] Show used instead of free disk --- bumblebee/modules/disk.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bumblebee/modules/disk.py b/bumblebee/modules/disk.py index 9e8ccf1..2089761 100644 --- a/bumblebee/modules/disk.py +++ b/bumblebee/modules/disk.py @@ -23,18 +23,18 @@ class Module(bumblebee.module.Module): st = os.statvfs(self._path) self._size = st.f_frsize*st.f_blocks - self._free = st.f_frsize*st.f_bavail - self._perc = 100.0*self._free/self._size + self._used = self._size - st.f_frsize*st.f_bavail + self._perc = 100.0*self._used/self._size - return "{} {}/{} ({:05.02f}%)".format(self._path, bumblebee.util.bytefmt(self._free), bumblebee.util.bytefmt(self._size), self._perc) + return "{} {}/{} ({:05.02f}%)".format(self._path, bumblebee.util.bytefmt(self._used), bumblebee.util.bytefmt(self._size), self._perc) def instance(self): return self._path def warning(self): - return self._perc < 20 + return self._perc > 80 def critical(self): - return self._perc < 10 + return self._perc > 90 # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4