Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: quota checking with Linux and Solaris??

by Abigail-II (Bishop)
on Feb 16, 2004 at 15:34 UTC ( #329328=note: print w/replies, xml ) Need Help??

in reply to quota checking with Linux and Solaris??

You can't just mount a filesystem and run a command to determine what the quota is, as set by the box the filesystem is from. That's not how things work.

If you want to know the quota stats of user A on box B of filesystem C, you need to be on box B. Mounting filesystem C on system D isn't going to give you the answer.

However, I don't see what this has to do with Perl.


  • Comment on Re: quota checking with Linux and Solaris??

Replies are listed 'Best First'.
Re: Re: quota checking with Linux and Solaris??
by sunadmn (Curate) on Feb 16, 2004 at 16:33 UTC
    Abigail the perl portion of this is weather to use a small perl server i.e. Net::TCP::Server or some other varriant of a mod to bind to a port on the NFS server and listen for incoming requests for a quota check on a specfic user. This is where I get confused cause I am not exactly sure how to make this wrk correctly and feed back the info I get to the web server which is running on a Linux box. I hope this helps clear up any confusion as to what I am indeed asking for advice on.
      You could indeed set up a TCP client/server model. The server could be stand alone, or be run from inetd. You could use a model where you make a connection for reach request, or you could have a permanent connection. You could use UDP for communication as well. Or you could create a file or database with all the quota information, which you update from the NFS server once every hour/day/week/whatever, and consult from the webserver side. Yet another possibility is to forget the entire web thing, and have people just type 'quota' on the box itself - after all, if they don't have access to the box, it doesn't matter what their quota is.

      That's a decision you have to make, and what is the right decision depends on many things. But one thing that hardly plays a role in which solution you are going to take is the language in which the solution will be written.

      Abigail (wondering why someone wants to make an HTTP request to box A, just to get the quota information on box B.)

        nfsclient# mount -F nfs /data01

        on there is a user entry in /etc/passwd that looks like this:
        waswas:*:75:75:Waswas Willbe:/saredata01/home/waswas:/noshell
        In this case the user has no access to login to the actual nfs server but the user and uid does exist and is matched from the nfs server and client. Quotas still apply.

        I do no know what the setup is on the OP's network -- nor what the "Linux and Solaris don't talk" junk is about. What I would do is set up a cron on the nfs servers that runs a perl script that gets the output from repquota or vxrepquota and parses it then inserts it into a db server somewhere. The web app can then query the database and pull out the usage and quota info for the nfs server that is needed -- with no root level exposure to the nfs server.


        PS Abigail-II: It makes sense to do the http request to machine A if the sysadmin wants to limit the scope of the end user. lets say I have 15 nfs mounts on 10 different servers exposed via CIFS/AFP/WEB on server A, I can show the quotas on different end user exposed directories without having the users know all of the details about the backend implementation. I do not know about you, but in my environment I can't expect end users to telnet to a machine and get quota info, much less to understand quota's and the backend implementation. I have to show them a nice interface that explains "hey silly, this you are at your size limit on this directory, please delete some stuff or call the helpdesk for more info!\n"; =)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://329328]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2017-07-20 23:01 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (316 votes). Check out past polls.