Module: check_mk
Branch: master
Commit: 3268a2ee4e447229d743d821274e9e09717bb607
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3268a2ee4e4472…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Mon Mar 31 15:02:12 2014 +0200
nfsexports.solaris: new agent plugin for monitoring nfs exports on solaris systems
This agent plugin delivers information about nfs exports on Solaris systems in
stand-alone
as well as clustered environments.
---
.werks/600 | 9 ++++++
ChangeLog | 1 +
agents/solaris/nfsexports.solaris | 57 +++++++++++++++++++++++++++++++++++++
3 files changed, 67 insertions(+)
diff --git a/.werks/600 b/.werks/600
new file mode 100644
index 0000000..89d8d4b
--- /dev/null
+++ b/.werks/600
@@ -0,0 +1,9 @@
+Title: nfsexports.solaris: new agent plugin for monitoring nfs exports on solaris
systems
+Level: 1
+Component: checks
+Version: 1.2.5i2
+Date: 1396270818
+Class: feature
+
+This agent plugin delivers information about nfs exports on Solaris systems in
stand-alone
+as well as clustered environments.
diff --git a/ChangeLog b/ChangeLog
index a32df95..a0cf1b1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
* 0775 ibm_svc_systemstats.diskio: new check for disk throughput in IBM SVC / V7000
devices in total
* 0764 lnx_quota: Added new check to monitor Linux File System Quota...
* 0776 ibm_svc_nodestats.cpu_util: new check for CPU Utilization per Node on IBM SVC
/ V7000 devices
+ * 0600 nfsexports.solaris: new agent plugin for monitoring nfs exports on solaris
systems...
* 0740 FIX: winperf_if: now able to handle bandwidth > 4GBit...
Multisite:
diff --git a/agents/solaris/nfsexports.solaris b/agents/solaris/nfsexports.solaris
new file mode 100644
index 0000000..39c6443
--- /dev/null
+++ b/agents/solaris/nfsexports.solaris
@@ -0,0 +1,57 @@
+#!/usr/bin/bash
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2010 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at
http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+# Check_MK agent plugin for monitoring nfsexports on Solaris. This plugin
+# has been tested with solaris 10 in a standalone and cluster setting.
+
+clusterconfigdir="/etc/cluster/ccr/global/directory"
+if [ -r $clusterconfigdir ]; then
+ # is a clustered nfs server
+ nfsconfig=/etc/cluster/ccr/global/`grep rgm $clusterconfigdir | grep nfs | grep
rg_`
+ if [ -r $nsconfig ]; then
+ Pathprefix=`grep Path $nfsconfig | awk {'print $2'}`/SUNW.nfs
+ dfstabfile=$Pathprefix/dfstab.`grep -v FilesystemMountPoints $nfsconfig | grep
SUNW.nfs | \
+ awk {'print $1'} | sed -e 's/RS_//'`
+ if [ -r $dfstabfile ]; then
+ EXPORTS=`grep -v ^# $dfstabfile | grep -v ^$`
+ ps -aef | grep nfsd | grep $Pathprefix >/dev/null &&
DAEMONS="ok"
+ fi
+ fi
+else
+ # is a standalone nfs server
+ dfstabfile="/etc/dfs/dfstab"
+ if [ -r $dfstabfile ]; then
+ EXPORTS=`grep -v ^# $dfstabfile | grep -v ^$`
+ svcs -a | grep nfs/server | grep ^online >/dev/null &&
DAEMONS="ok"
+ fi
+fi
+
+# any exports or have running daemons? then look for registered exports
+if [ "$EXPORTS" ]; then
+ echo "<<<nfsexports>>>"
+ if [ "$DAEMONS" ]; then
+ showmount -e | grep ^/
+ fi
+fi