+#!/bin/sh
+
+if [ $# -lt 1 ]
+then
+ echo "Usage: $0 <fs> [email]"
+ echo "Where"
+ echo " fs - file system to check"
+ echo " email - send warning to specified e-mail address (print to stdout, if omitted)"
+ echo "Example: $0 /srv/remoteshare admin@cutekittens.tld"
+ exit 1
+fi
+
+make_command()
+{
+ if [ -z "$1" ]
+ then
+ echo "cat"
+ else
+ echo "mail -s \"$subject\" $1"
+ fi
+}
+
+if ! mount | grep "on $1 type nfs" > /dev/null
+then
+ subject="WARNING! Network file system ($1) on $(hostname) is not mounted!"
+
+ [ -z "$2" ] && echo "${subject}"
+ CMD=$(make_command "$2")
+ eval ${CMD} << EOT
+This is to inform you that no NFS is mounted at $1.
+Please investigate immediately!
+EOT
+exit 2
+
+elif ! timeout 15 stat "$1" > /dev/null
+then
+ subject="WARNING! Network file system ($1) on $(hostname) is hanging/unreachable!"
+
+ [ -z "$2" ] && echo "${subject}"
+ CMD=$(make_command "$2")
+ eval ${CMD} << EOT
+This is to inform you that network share $1 is hanging/unreachable.
+
+Mount details:
+
+$(mount | grep "$1")
+
+Please investigate immediately!
+EOT
+exit 3
+
+fi