I've just been busy writing a script to manage and enforce quotas the "UNIX way" (i.e. lock down the quota at the soft limit if the user doesn't cleanup within 14 days of exceeding it).
The CPAN Perl "Quota" module works a treat:
use Quota;
$host='filer'; $volume_path = '/vol/vol1/users'; $uid = 501; ($block_curr, $block_soft, $block_hard, $block_timelimit, $inode_soft, $inode_hard, $inode_timelimit) = Quota::rpcquery($host, $volume_path, $uid);
It's pretty fast and appears to work on HP-UX, Solaris and Linux. The only thing you have to watch for is that the results are low while the quotas are resizing (easy to check with a SNMP query).
Regards,
Barrie
-----Original Message----- From: owner-toasters@mathworks.com [mailto:owner-toasters@mathworks.com] On Behalf Of Jacek Nogala Sent: 21 February 2005 09:36 To: toasters@mathworks.com Subject: Quick access to quota information
The landscape: - The company is cable tv providing also Internet services - They intend to use FAS920 in NFS environment (all servers are Linux) - At this very moment they are servicing about 80k users but wanting to be able to service more that 200k - Services for users are to be implemented with UID and GID quotas
Requirements: - They need to be able to retrieve quickly information about current quota usage for each specific UID or GID. - The information will be available via: -- Call Center - estimated queries 12 times per minute -- WEB GUI for users - estimated queries 120 times per minute - The quota information should be retrieved within 2 s and should be not older than 30 s - There is not specific requirements regarding method of getting the result (SNMP/RSH/NFS RPC/HTTP are acceptable)
We discussed with them SNMPwalk and quota report parsing but they cannot accept it due to high and growing number of users. The most convenient way would be short series of SNMP queries for specific UID / GID.
Any suggestions other than "make and parse quota report" are welcome.
Best regards,
Jacek
barrie_spence@agilent.com wrote:
I've just been busy writing a script to manage and enforce quotas the "UNIX way" (i.e. lock down the quota at the soft limit if the user doesn't cleanup within 14 days of exceeding it).
The CPAN Perl "Quota" module works a treat:
use Quota;
$host='filer'; $volume_path = '/vol/vol1/users'; $uid = 501; ($block_curr, $block_soft, $block_hard, $block_timelimit, $inode_soft, $inode_hard, $inode_timelimit) = Quota::rpcquery($host, $volume_path, $uid);
It's pretty fast and appears to work on HP-UX, Solaris and Linux. The
You are right. I did some tests comparing issuing quota command and this procedure call. In the first case collecting several quota results took under 50 ms. In the second case - under 4 ms. So it was fast enough to use it as workaround for calculating group quota by summing up quota usage of all UIDs in the group. (assuming that only few UIDs belong to GID).
Thank you very much for good hint!
Best regards,
Jacek