Originally Posted by hk_centos
still i'm having same problem mates.
I'm unable to get machines IP's which were successfully mounted into NFS Client. Actually my NFS client work as distributor. he will store the data files among his NFS servers. NFS server only export his location to NFS client.(one NFS client and many NFS servers)
to store data files NFS client need to know what are the successfully mounted remote locations(NFS Servers).Because some NFS server machine can be in power off state. therefore i need to get success fully mounted NFS servers IP's
Please Help Me Friends,
I'm a bit confused, by this. You have 1 client and multiple servers?
The mount is initiated by the client, so if you have only one client, that is where you need to look, namely in the client. As pointed out before by the_bigbalu, you just need to look at /etc/mtab, which will tell you what is currently mounted at the moment by the server. You could also just run mount, which will tell you what file systems the client has mounted.
In order to run a script during shutdown, just place the script in /etc/rc.d/rc0.d (/etc/rc.d/rc6.d for reboot) and prepend Knn to the name of the script, where nn is a number that indicates the running order of the script if memory serves right.
To check whether a server is up, you could ping the host once ping <ip> -c 1 and parse the output to check whether it responds.
Hope this helps, but I'm not sure this is what you want.