diff options
Diffstat (limited to 'meta-webserver/recipes-webadmin/ajenti/ajenti/0002-plugins-hddstat-fix-disk-usage-check-to-work-with-bu.patch')
-rw-r--r-- | meta-webserver/recipes-webadmin/ajenti/ajenti/0002-plugins-hddstat-fix-disk-usage-check-to-work-with-bu.patch | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/meta-webserver/recipes-webadmin/ajenti/ajenti/0002-plugins-hddstat-fix-disk-usage-check-to-work-with-bu.patch b/meta-webserver/recipes-webadmin/ajenti/ajenti/0002-plugins-hddstat-fix-disk-usage-check-to-work-with-bu.patch new file mode 100644 index 0000000000..48c255dbb1 --- /dev/null +++ b/meta-webserver/recipes-webadmin/ajenti/ajenti/0002-plugins-hddstat-fix-disk-usage-check-to-work-with-bu.patch @@ -0,0 +1,29 @@ +From cde811cfffba48c148b60fb1083fe8fd409b8b24 Mon Sep 17 00:00:00 2001 +From: Paul Eggleton <paul.eggleton@linux.intel.com> +Date: Tue, 13 Mar 2012 01:52:34 +0000 +Subject: [PATCH 1/2] plugins/hddstat: fix disk usage check to work with + busybox + +busybox df does not have --total, so fake it using awk. + +Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> +--- + plugins/hddstat/usage.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/plugins/hddstat/usage.py b/plugins/hddstat/usage.py +index 3c84181..cf5f037 100644 +--- a/plugins/hddstat/usage.py ++++ b/plugins/hddstat/usage.py +@@ -7,7 +7,7 @@ class DiskUsageMeter(LinearMeter): + transform = 'percent' + + def get_usage(self): +- u = int(shell('df --total | grep total').split().pop().strip('%')) ++ u = int(round(float(shell("df -P | awk 'NR > 1 {total+=$3+$4 ; used+=$3} END { print used/total*100}'").strip()))) + return u + + def get_value(self): +-- +1.7.4.4 + |