Module: check_mk
Branch: master
Commit: cf626b6dceb5de85a4ef0eefa417abbae61a2798
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cf626b6dceb5de…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Wed Oct 29 09:41:07 2014 +0100
#1194 Linux Agent now supports monitoring of cifs mounts
---
.werks/1194 | 9 +++++++++
ChangeLog | 1 +
agents/check_mk_agent.linux | 14 ++++++++++++++
3 files changed, 24 insertions(+)
diff --git a/.werks/1194 b/.werks/1194
new file mode 100644
index 0000000..4217f9b
--- /dev/null
+++ b/.werks/1194
@@ -0,0 +1,9 @@
+Title: Linux Agent now supports monitoring of cifs mounts
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i6
+Date: 1414572031
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 777ff18..c99ad78 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -82,6 +82,7 @@
* 1190 statgrab_cpu: Check can now handle parameters
* 1191 Linux agent now also sends information about tmpfs...
* 1193 ps: Manual Checks can now use RegEx for user matching...
+ * 1194 Linux Agent now supports monitoring of cifs mounts
* 1051 FIX: tcp_conn_stats: fix missing performance data...
* 1142 FIX: winperf_ts_sessions: fix computation, check has never really worked
* 1090 FIX: zfsget: fixed exception which happened on incomplete zfs entries
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index bc1c7df..248f2b4 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -166,6 +166,20 @@ then
printf '\n'|| echo "$MP hanging 0 0 0 0"
fi
done
+
+ echo '<<<cifsmounts>>>'
+ sed -n '/ cifs\? /s/[^ ]* \([^ ]*\) .*/\1/p' < /proc/mounts |
+ sed 's/\\040/ /g' |
+ while read MP
+ do
+ if [ $STAT_VERSION != $STAT_BROKE ]; then
+ waitmax -s 9 2 stat -f -c "$MP ok %b %f %a %s" "$MP" ||
\
+ echo "$MP hanging 0 0 0 0"
+ else
+ waitmax -s 9 2 stat -f -c "$MP ok %b %f %a %s" "$MP"
&& \
+ printf '\n'|| echo "$MP hanging 0 0 0 0"
+ fi
+ done
fi
# Check mount options. Filesystems may switch to 'ro' in case