2004-04-07 08:04:02

by Michael

[permalink] [raw]
Subject: auto-discovery of exports?

Windows with the SFU add-on, allowing it to work as an NFS client,
manages to scan my network for NFS servers and then show the exported
filesystem under each of those servers. How could I implement the same
thing in Linux?

I ask because I want to write a program that autoscans my network for
certain files (images, music, video) that are readable and displays them
in a nice viewer to the user without needing to go searching for them. I
want the system to be flexible enough that it can allow machines to be
plugged in and out of the network and still detect those shared files
when available without any effort by the user.


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs


2004-04-08 05:34:36

by Bryan O'Sullivan

[permalink] [raw]
Subject: RE: auto-discovery of exports?

On Wed, 2004-04-07 at 17:37, Ian Kent wrote:

> Fine but how would you enumerate the hosts?

nmap -sR

<b



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2004-04-08 10:30:03

by Michael

[permalink] [raw]
Subject: Re: auto-discovery of exports?

Thanks everyone for the input. Based on your suggestions I quickly put
together this rough shell script which seems to work. It correctly found
every nfs server on my LAN and listed the exports each had.

---------------
#!/bin/bash

PORT='111'
NETWORK='192.168.1.0/24'

NMAP='/usr/bin/nmap'
SHOWMOUNT='/usr/sbin/showmount'

IPs=`$NMAP -PT$PORT $NETWORK | grep "Interesting ports on" | cut -d" "
-f4 | cut -d":" -f1`

for IP in $IPs ; do
$SHOWMOUNT -e $IP
done
---------------


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2004-04-07 23:01:41

by Guolin Cheng

[permalink] [raw]
Subject: RE: auto-discovery of exports?

Hi, Michael,

Run shell command "showmount -e|--exports <server_to_be_questioned>".
If you would like to scan your network to check each host, run a for
loop, and in the loop put another command "rpcinfo -p
<server_to_be_questions> |grep nfs" to make sure whether the nfs server
is running on the host, if so, run the showmount command to query the
exported file system from the host.=20

Read manuals you will get more options, although the above should be
enough for your purposes.

--Guolin Cheng


-----Original Message-----
From: Michael [mailto:[email protected]]=20
Sent: Wednesday, April 07, 2004 1:04 AM
To: [email protected]
Subject: [NFS] auto-discovery of exports?

Windows with the SFU add-on, allowing it to work as an NFS client,=20
manages to scan my network for NFS servers and then show the exported=20
filesystem under each of those servers. How could I implement the same=20
thing in Linux?

I ask because I want to write a program that autoscans my network for=20
certain files (images, music, video) that are readable and displays them

in a nice viewer to the user without needing to go searching for them. I

want the system to be flexible enough that it can allow machines to be=20
plugged in and out of the network and still detect those shared files=20
when available without any effort by the user.


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=3D1470&alloc_id=3D3638&op=3Dcli=
ck
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2004-04-08 00:31:49

by Ian Kent

[permalink] [raw]
Subject: RE: auto-discovery of exports?

On Wed, 7 Apr 2004, Guolin Cheng wrote:

> Hi, Michael,
>
> Run shell command "showmount -e|--exports <server_to_be_questioned>".
> If you would like to scan your network to check each host, run a for
> loop, and in the loop put another command "rpcinfo -p
> <server_to_be_questions> |grep nfs" to make sure whether the nfs server
> is running on the host, if so, run the showmount command to query the
> exported file system from the host.

Fine but how would you enumerate the hosts?
Would you restrict this to the local subnet?

Ian



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs