|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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, |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
forward the output of the df -k command to /dev/null and ask for the exit status of the command... Code:
df -k | grep test | grep -v grep > /dev/null echo $? the output should be a "1" or "0" depending if "test" is present! |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
we monitor nfs-filesystems simply with a file nfs.txt on each share
if the file is readable the share must be ok |
|
#4
|
||||
|
||||
|
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.
|
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
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 |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Mount point options | Sunguy222 | UNIX for Advanced & Expert Users | 1 | 04-24-2008 06:23 PM |
| ssh with shared mount point | devjxh | Solaris | 4 | 11-30-2007 07:54 AM |
| auto mount point | legato | UNIX for Dummies Questions & Answers | 1 | 02-15-2005 03:11 PM |
| mount point | colesy | UNIX for Dummies Questions & Answers | 1 | 01-06-2004 06:03 AM |
| sdX to mount point mapping | marist89 | UNIX for Dummies Questions & Answers | 2 | 10-24-2001 07:06 PM |
|
|