The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Operating Systems > AIX
.
google unix.com



AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

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 07:23 PM
ssh with shared mount point devjxh SUN Solaris 4 11-30-2007 08:54 AM
auto mount point legato UNIX for Dummies Questions & Answers 1 02-15-2005 04:11 PM
mount point colesy UNIX for Dummies Questions & Answers 1 01-06-2004 07:03 AM
sdX to mount point mapping marist89 UNIX for Dummies Questions & Answers 2 10-24-2001 08:06 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-30-2009
elmesy elmesy is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 11
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,
  #2 (permalink)  
Old 06-30-2009
DukeNuke2's Avatar
DukeNuke2 DukeNuke2 is offline Forum Staff  
Soulman
  
 

Join Date: Jul 2006
Location: Germany, Berlin
Posts: 2,993
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!
  #3 (permalink)  
Old 06-30-2009
funksen funksen is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2006
Location: Austria/Vienna
Posts: 431
we monitor nfs-filesystems simply with a file nfs.txt on each share

if the file is readable the share must be ok
  #4 (permalink)  
Old 06-30-2009
DukeNuke2's Avatar
DukeNuke2 DukeNuke2 is offline Forum Staff  
Soulman
  
 

Join Date: Jul 2006
Location: Germany, Berlin
Posts: 2,993
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.
  #5 (permalink)  
Old 06-30-2009
elmesy elmesy is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 11
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
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:17 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0