logo       

Re: Detecting whether an NFS share is offline: msg#00076

sysutils.backup.rsnapshot.general

Subject: Re: Detecting whether an NFS share is offline

On Tue, Aug 22, 2006 at 06:17:26PM -0400, Dave Lerner wrote:

> I have two Linux Redhat servers: a production server and a backup
> server. The servers can access each other using NFS.
>
> I need a way for either server to detect whether the other is online and
> available for file transfer.
>
> I've found that if I attempt to mount one server from the other, e.g.
> "mount /mnt/prod" or "mount /mnt/backup", and the referenced server is
> down, the mount command never returns.

Try ping :-)

first here's what you get when pinging a host that's up ...

$ ping -c 1 195.149.50.60 > /dev/null 2>&1
$ echo $?
0

then a non-existent hostname:

$ ping -c 1 nosuchhost.example.com > /dev/null 2>&1
$ echo $?
68

and finally an IP that doesn't respond:

$ ping -c 1 195.149.50.62 > /dev/null 2>&1
$ echo $?
2

If you are specifically having NFS problems and not reachability
problems, then it looks like there might be some useful stuff to try in
the mount_nfs manpage.

--
David Cantrell | Enforcer, South London Linguistic Massive

23.5 degrees of axial tilt is the reason for the season

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise