Module: check_mk
Branch: master
Commit: e957b91c43d01520d0f256fd7f438ab86bc7fd23
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e957b91c43d015…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Jun 8 15:06:27 2017 +0200
4778 FIX lnx_quotas: Adapted plugin output if TABS are used in fstab
Change-Id: Ib7b20bbeb7f563a3c31d7ed5ce37037a7e0bb020
---
.werks/4778 | 11 +++++++++++
agents/plugins/lnx_quota | 4 ++--
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/.werks/4778 b/.werks/4778
new file mode 100644
index 0000000..95a21ad
--- /dev/null
+++ b/.werks/4778
@@ -0,0 +1,11 @@
+Title: lnx_quotas: Adapted plugin output if TABS are used in fstab
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1496927102
+
+
diff --git a/agents/plugins/lnx_quota b/agents/plugins/lnx_quota
index 4f167bd..919417b 100755
--- a/agents/plugins/lnx_quota
+++ b/agents/plugins/lnx_quota
@@ -27,13 +27,13 @@ if type repquota >/dev/null ; then
echo "<<<lnx_quota>>>"
# User Quota
- for VOL in $(grep -E usr[j]?quota /etc/fstab | cut -d' ' -f2); do
+ for VOL in $(grep -E usr[j]?quota /etc/fstab | tr -s '\t' ' ' | cut
-d' ' -f2); do
echo "[[[usr:$VOL]]]"
repquota -up $VOL | tail -n +6 | head -n -2
done
# Group Quota
- for VOL in $(grep -E grp[j]?quota /etc/fstab | cut -d' ' -f2); do
+ for VOL in $(grep -E grp[j]?quota /etc/fstab | tr -s '\t' ' ' | cut
-d' ' -f2); do
echo "[[[grp:$VOL]]]"
repquota -gp $VOL | tail -n +6 | head -n -2
done