Network and Storage Protocols

Reports from netgroup/exports


I'm looking to generate a report from the netgroup and exports files showing what host has what access (readonly, read/write) to which file systems.  Given that the negroup files contain nested groups, parsing it is non-trivial so I'm hoping that somebody has already done the work.

The final goal is to be able to generate an fstab for a host based on the permissions that the filer has.  If we add a host to a netgroup, we should be able to regenerate fstab entries for all file systems on that filer with the right mount options (ro, rw).

Any pointers would be greatly appreciated!





There is no direct or concise way to get the list that you are asking for.

From the clients you can use - "showmount -e <ipaddr_NetApp Storage>". This will list all the mounts upto 10000 entries.

From the NetApp Storage you can possiblely this information at one single point of time from the access cache contents.

The volume "test_vol" is exported out from the /etc/exports as follows:

/ect/test_vol     -sec=sys,ro=,rw=,root=,nosuid

fas6080c-svl13*> exportfs -c /vol/test_vol -ro

exportfs: has ro access to /vol/test_vol


Thanks Bikash, but that doesn't really help because you have not factored in the netgroup file at all.

The export uses entries like rw=@hostlist.  Given that, you need to go through the netgroup file where you may have nested netgroup entries (we do here).  So it's actually a fairly complex matter to determine which host has access to which exports.

I'm actually quite surprised that nobody has written anything like this before since it's pretty close to imperative for audit purposes.  Manually generating a list of which hosts have access to a specific mount point can be a very time-consuming exercise.