Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clients that are NFS connected to Server

Status
Not open for further replies.

hfaix

MIS
Nov 25, 2003
596
US
Does anyone know of a way to determine (from an AIX 5.3 NFS Server) if any hosts are NFS mounted to the server.

I have searched many threads on here, and this is the closest one I've gotten to a solution. thread52-1139757.

netstat -an |grep 2049 works great....assuming a connection has been recently established. After a few minutes of inactivity, the netstat doesn't show the connect any more.

showmount -d is ok for most cases, but this happens to be a NIM server so most of the entries that show up with showmount -d are wrong.

I would like to try the lsof command, but I haven't figured out the syntax yet.

Any help would be great.
 
Thanks for the reply.

That's the info I'm looking for. I was hoping to find a way to do it from a script (tough to do with a trace).

 
I thought I'd post what I ended up doing. I wrote a piece of coded to ssh each client and check for "my" hostname.



Code:
# Used to see if any systems are mounted to me.
hostfile=/export/custom/ssh/inputs/custom

if [[ -s $hostfile ]]
then
   for host in $(cat $hostfile)
   do
     if ( ssh $host df | grep -q "$(hostname):" )
     then
         echo $host "Connected"
     else
         echo $host "Not connected"
     fi
    done
fi
 
showmount -a is completely wrong on this particular system. It's a NIM server that I do NFS mksysb's to. All sorts of stuff reported with this command.

do you have a suggested lsof command...if so that would be great? I didn't find any flags that pertained to this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top