How 2 check the availability of a NFS Server

How 2 check the availability of a NFS Server

Post by Christian Fand » Tue, 17 Jun 2003 15:39:45



Hi,

I'm looking for a suitable algorithm checking the availability of a
NFS server. Hihterto I found:

   - processing the output of 'df -k' ... but the output depends
     on the OS
   - ( $dev, undefined ) = stat $filename;
   - building a socket, sending somewhat to the socket und receive
     a result. Receiving is secured by a timeout algorithm

My favourite (at the very moment) is the last item; but sending
produces headaches: where can I find suitable flags for achieving my
goal ??

(:
BR
Christian Fandel

 
 
 

How 2 check the availability of a NFS Server

Post by Michel Bardiau » Sat, 21 Jun 2003 21:46:29



> Hi,

> I'm looking for a suitable algorithm checking the availability of a
> NFS server. Hihterto I found:

>    - processing the output of 'df -k' ... but the output depends
>      on the OS
>    - ( $dev, undefined ) = stat $filename;
>    - building a socket, sending somewhat to the socket und receive
>      a result. Receiving is secured by a timeout algorithm

> My favourite (at the very moment) is the last item; but sending
> produces headaches: where can I find suitable flags for achieving my
> goal ??

What special properties does your send() require? Just do the timeout
over the whole send/recv group. No special flags required.

Quote:

> (:
> BR
> Christian Fandel

--
Michel Bardiaux
Peaktime Belgium S.A.  Bd. du Souverain, 191  B-1160 Bruxelles
Tel : +32 2 790.29.41

 
 
 

How 2 check the availability of a NFS Server

Post by Andrew Gabri » Wed, 25 Jun 2003 10:02:49




Quote:> Hi,

> I'm looking for a suitable algorithm checking the availability of a
> NFS server. Hihterto I found:

>    - processing the output of 'df -k' ... but the output depends
>      on the OS
>    - ( $dev, undefined ) = stat $filename;
>    - building a socket, sending somewhat to the socket und receive
>      a result. Receiving is secured by a timeout algorithm

> My favourite (at the very moment) is the last item; but sending
> produces headaches: where can I find suitable flags for achieving my
> goal ??

Use rpcinfo(1M) to call nfs procedure 0 (procedure 0 just replies,
and can be used to ping the server at the nfs level)...

myhost% rpcinfo -t myhost nfs 2             # check nfs version 2 over TCP
program 100003 version 2 ready and waiting
myhost% rpcinfo -t myhost nfs 3             # check nfs version 3 over TCP
program 100003 version 3 ready and waiting
myhost% rpcinfo -u myhost nfs 2             # check nfs version 2 over UDP
program 100003 version 2 ready and waiting
myhost% rpcinfo -u myhost nfs 3             # check nfs version 3 over UDP
program 100003 version 3 ready and waiting
myhost%

--
Andrew Gabriel
Consultant Software Engineer