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).
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.