In article <bda7ce2f.0306152239.41e19bdposting.google.com> ,
[email]christian.fandelbvg.de[/email] (Christian Fandel) writes:
> 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