NFS mount point monitoring script

Hi,

I'm looking to create a NFS mount point monitoring shell script not sure if im going the right way about it so could do with some help. What i was thinking of doing was using the below command but am unsure how to handle the output. So if the filesyetem is active it will return "1" but if is not active It will return "0" how do I then handle the output from the below command in a shell script?

df -k | grep test | grep -v grep | wc -l

Thanks,

forward the output of the df -k command to /dev/null and ask for the exit status of the command...

df -k | grep test | grep -v grep > /dev/null
echo $?

the output should be a "1" or "0" depending if "test" is present!

we monitor nfs-filesystems simply with a file nfs.txt on each share

if the file is readable the share must be ok

something like this is a good practice... create a file on a share, check the file (write to it...) and delete it afterwards... if all of this works, the share should be good.

Thanks for the replies, I have just gone with this for now.

HOSTNM=`hostname`
DATE=$(date +"%d-%b-%y %H:%M")
SHORTNAME="FileSystem Mount"
LONGNAME="Filesystem Test"

#Checking Filesytem Test

df -k | grep Test
if [ $? == "1" ]
then

echo $LONGNAME is not running on $HOSTNM please investigate. Sent by myscript $DATE | mail -s "$SHORTNAME is not accessible" you@domain.com"

fi