Module: check_mk
Branch: master
Commit: 0d8626ef59fb49988d4ce2976c71942d85267917
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0d8626ef59fb49…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Apr 1 14:18:56 2015 +0200
#2186 check_mk_agent.aix: use GNU df in order to exclude NFS for filesystem monitoring
If the <tt>df</tt> command from the GNU <tt>coreutils</tt> is
present at
<tt>/usr/opt/freeware/bin/df</tt> then that is being used instead of the
AIX <tt>df</tt> command. This avoids a hanging agent in case of hanging
NFS mounts.
---
.werks/2186 | 12 ++++++++++++
ChangeLog | 1 +
agents/check_mk_agent.aix | 7 ++++++-
3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/.werks/2186 b/.werks/2186
new file mode 100644
index 0000000..a7cf334
--- /dev/null
+++ b/.werks/2186
@@ -0,0 +1,12 @@
+Title: check_mk_agent.aix: use GNU df in order to exclude NFS for filesystem monitoring
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i1
+Date: 1427890642
+Class: feature
+
+If the <tt>df</tt> command from the GNU <tt>coreutils</tt> is
present at
+<tt>/usr/opt/freeware/bin/df</tt> then that is being used instead of the
+AIX <tt>df</tt> command. This avoids a hanging agent in case of hanging
+NFS mounts.
diff --git a/ChangeLog b/ChangeLog
index 537c6a7..d56ee58 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -153,6 +153,7 @@
* 2184 statgrab_mem: converted to the same logic as the other memory checks...
NOTE: Please refer to the migration notes!
* 2185 canon_pages: added support for b/w A4 and color A4/A3 counters
+ * 2186 check_mk_agent.aix: use GNU df in order to exclude NFS for filesystem
monitoring...
* 1457 FIX: logins: new check renamed from "users" check...
NOTE: Please refer to the migration notes!
* 1762 FIX: lnx_thermal: Now ignoring trip points with level 0...
diff --git a/agents/check_mk_agent.aix b/agents/check_mk_agent.aix
index 8744752..0edfa08 100755
--- a/agents/check_mk_agent.aix
+++ b/agents/check_mk_agent.aix
@@ -116,7 +116,12 @@ echo Version: 1.2.7i1
echo AgentOS: aix
echo '<<<df>>>'
-df -kP | sed 's/ / - /' | grep -v ^/proc | grep -v ^Filesystem | grep -v :
+if [ -x /usr/opt/freeware/bin/df ] ; then
+ excludefs="-x smbfs -x cifs -x iso9660 -x udf -x nfsv4 -x nfs -x mvfs -x
zfs"
+ /usr/opt/freeware/bin/df -PTlk $excludefs | sed 1d
+else
+ df -kP | sed 's/ / - /' | grep -v ^/proc | grep -v ^Filesystem | grep -v :
+fi
# Check for hanging NFS mounts. This needs a GNU stat installed in the PATH
if type stat >/dev/null 2>&1 ; then