Module: check_mk
Branch: master
Commit: a255edb6a8dfe1cd0bc4e9524cde1adb8426a56d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a255edb6a8dfe1…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Aug 24 18:21:44 2014 +0200
Fix nfsmounts plugin
---
agents/plugins/nfsexports | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/agents/plugins/nfsexports b/agents/plugins/nfsexports
index 46970cc..168f5c2 100755
--- a/agents/plugins/nfsexports
+++ b/agents/plugins/nfsexports
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
@@ -30,12 +30,9 @@
if [ -r /etc/exports ]; then
EXPORTS=$(grep -v -e ^# -e ^$ /etc/exports)
fi
-pgrep '(portmap|rpcbind)' >/dev/null && pgrep rpc.mountd >/dev/null
&& DAEMONS="ok"
-# any exports or have running daemons? then look for registered exports
-if [[ $EXPORTS ]]; then
+if [ "$EXPORTS" ] && pgrep '(portmap|rpcbind)' >/dev/null
&& pgrep rpc.mountd >/dev/null
+then
echo "<<<nfsexports>>>"
- if [[ $DAEMONS ]]; then
- waitmax 3 showmount --no-headers -e
- fi
+ waitmax 3 showmount --no-headers -e
fi