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 000000000..48c255dbb --- /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 @@ | |||
1 | From cde811cfffba48c148b60fb1083fe8fd409b8b24 Mon Sep 17 00:00:00 2001 | ||
2 | From: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
3 | Date: Tue, 13 Mar 2012 01:52:34 +0000 | ||
4 | Subject: [PATCH 1/2] plugins/hddstat: fix disk usage check to work with | ||
5 | busybox | ||
6 | |||
7 | busybox df does not have --total, so fake it using awk. | ||
8 | |||
9 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
10 | --- | ||
11 | plugins/hddstat/usage.py | 2 +- | ||
12 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
13 | |||
14 | diff --git a/plugins/hddstat/usage.py b/plugins/hddstat/usage.py | ||
15 | index 3c84181..cf5f037 100644 | ||
16 | --- a/plugins/hddstat/usage.py | ||
17 | +++ b/plugins/hddstat/usage.py | ||
18 | @@ -7,7 +7,7 @@ class DiskUsageMeter(LinearMeter): | ||
19 | transform = 'percent' | ||
20 | |||
21 | def get_usage(self): | ||
22 | - u = int(shell('df --total | grep total').split().pop().strip('%')) | ||
23 | + u = int(round(float(shell("df -P | awk 'NR > 1 {total+=$3+$4 ; used+=$3} END { print used/total*100}'").strip()))) | ||
24 | return u | ||
25 | |||
26 | def get_value(self): | ||
27 | -- | ||
28 | 1.7.4.4 | ||
29 | |||