Any plans to include a switch to "quota report" to display only tree-type quotas? I don't see anything obvious in the manual to do this. I have a couple of filers that take can take half an hour to do a complete "quota report" when they're busy, 99.9% of the time looking up and displaying derived user quotas.
I have a script that generates HTML quota reports which runs from a central admin host. I'd prefer to run it without requiring a config file listing quota trees, or kludge together some way to see which quota trees are defined (maybe use rdfile? ick...), send multiple rsh commands, collate the results, etc. I've got the data massaging working with the output of a single "quota report ; df ; df -i". It would be nice to keep that. :)
Brian, there is no kludge to it. rsh to your filer and run a "quota report" then just grep for "tree". As you can see here, the quota type is in the first field.
[root@mspadmin2.dal.mslp.ti.com] rsh regina quota report | more K-Bytes Files Type ID Volume Tree Used Limit Used Limit Quota Specifier ----- -------- -------- -------- ------- ------- -------- -------- ----------------- tree 1 vol3 everestTLM 834940 6291456 25212 - /vol/vol3/everestTLM tree 3 vol3 abs 4114328 4194304 224515 - /vol/vol3/abs
Another way is to mount your filer's /etc directory and read the third field from the quotas file which also classifies the quota as shown below.
[root@mspadmin2.dal.mslp.ti.com] more quotas /vol/vol0/5062_2_3 tree 6G /vol/vol1/pbmic tree 6G
Myself I use the quota report becuase not only does it give me the limit but what is currently being used so that I can calculate total usage from that.
Hope this helps.
-gdg
Brian Tao wrote:
Any plans to include a switch to "quota report" to display only
tree-type quotas? I don't see anything obvious in the manual to do this. I have a couple of filers that take can take half an hour to do a complete "quota report" when they're busy, 99.9% of the time looking up and displaying derived user quotas.
I have a script that generates HTML quota reports which runs from
a central admin host. I'd prefer to run it without requiring a config file listing quota trees, or kludge together some way to see which quota trees are defined (maybe use rdfile? ick...), send multiple rsh commands, collate the results, etc. I've got the data massaging working with the output of a single "quota report ; df ; df -i". It would be nice to keep that. :) -- Brian Tao (BT300, taob@risc.org) "Though this be madness, yet there is method in't"
On Mon, 8 Oct 2001, Mr. G. D. Geen wrote:
Brian, there is no kludge to it. rsh to your filer and run a "quota report" then just grep for "tree". As you can see here, the quota type is in the first field.
That's what I do now, but the Netapp still has to run through the entire "quota report" command. I would prefer a way just to have it list the tree quotas, and exit. As I mentioned, it takes a second to list the tree quotas, but half an hour or more during peak usage times to scroll through all of the rest of the user quotas.
Another way is to mount your filer's /etc directory and read the third field from the quotas file which also classifies the quota as shown below.
[root@mspadmin2.dal.mslp.ti.com] more quotas /vol/vol0/5062_2_3 tree 6G /vol/vol1/pbmic tree 6G
The /etc directory is not always mountable on the host that runs the script, and I believe that would mean sending multiple rsh commands, or constructing a compound command line to run multiple "quota report" commands. It'd be a heck of a lot easier if I could just do a "quota report -T" (-t is taken already in 6.x) and have the filer figure it out. ;-)
Myself I use the quota report becuase not only does it give me the limit but what is currently being used so that I can calculate total usage from that.
I'm using it for total usage as well as overcommitment of quota trees on disk space and inodes. Sample output (115 characters wide... apologies if your mailer auto-wraps this for you):
STAGE-NA1 QTREE REPORT: Volume Quota tree name Disk space (used/free/total) Inodes (used/free/total) -------- ----------------------- --------------------------------------- ------------------------------------ vol0 {DEFAULT} 0 1048576 1048576 0.0%-- 0 10240 10240 0.0%-- vol0 ariba-stage 0 5242880 5242880 0.0%-- 1 10239 10240 0.0%-- vol0 oracle-stage 62249064 11151256 73400320 84.8% 9892 10588 20480 48.3% vol0 marketplace 808488 9677272 10485760 7.7% 12239 8241 20480 59.8% vol0 netflow 20823868 31604932 52428800 39.7% 84281 69319 153600 54.9% vol0 devo-6-ora 489864 558712 1048576 46.7% 5883 4357 10240 57.5% vol0 informatica 275532 773044 1048576 26.3% 590 9650 10240 5.8% -------------------------------- --------------------------------------- ------------------------------------ vol0 PROVISIONED CAPACITY 84646816 60056672 144703488 58.5% 112886 122634 235520 47.9% vol0 ACTUAL CAPACITY 84952100 58041284 142993384 59.4% 113893 5126976 5240869 2.2% vol0 OVERCOMMITMENT 1710104 101.2% -5005349 4.5%
I have a script that generates HTML quota reports which runs from a central admin host. I'd prefer to run it without requiring a config file listing quota trees, or kludge together some way to see which quota trees are defined (maybe use rdfile? ick...),
I've never tried it, but try tinkering with the qrVTable mib table.. Glancing at the mib, I don't see a handy way of retriving entries of just type qrVTree (would appear to be a qtree), but it'll definately be easier to massage and much cleaner than an rsh kludge.
..kg..
Here's a fairly quick and automatic way to get your qtree quotas from a unix admin host. It consults /etc/quotas to get your qtrees and runs a quota report for each qtree, which is a lot faster than generating the big quota report for the whole filer, especially if you have a lot of users.
awk '$2 == "tree" && $1 != "*" { print("quota report", $1) }' \ /filer-root/etc/quotas > /filer-root/etc/tmp/qtscript
rsh filer source /vol/vol0/etc/tmp/qtscript | grep '^tree'
This assumes that your filer is running a recent enough release of ONTAP to have the "source" command. If it doesn't, you can have the awk script do this:
print("rsh filer quota report", $1)
and then run the resulting script file through a unix shell.
Steve Losen scl@virginia.edu phone: 434-924-0640
University of Virginia ITC Unix Support
On Mon, 8 Oct 2001, Steve Losen wrote:
awk '$2 == "tree" && $1 != "*" { print("quota report", $1) }' \ /filer-root/etc/quotas > /filer-root/etc/tmp/qtscript
rsh filer source /vol/vol0/etc/tmp/qtscript | grep '^tree'
This assumes that your filer is running a recent enough release of ONTAP to have the "source" command. If it doesn't, you can have the awk script do this:
print("rsh filer quota report", $1)
and then run the resulting script file through a unix shell.
I'm running ~5.3.6 on most of my filers, so that command is not available. I followed the same idea though, and simply had an awk statement construct a compound rsh command to the filer (sorry again... extreme line length warning):
% rsh nbc-na1 rdfile /etc/quotas | awk 'BEGIN { printf "rsh -n $FILER "; } ($2 == "tree") { printf("quota report %s \\; ", $1); } END { print " df \\; df -i | fgrep -v /.snapshot"; }' rsh -n $FILER quota report /depot \; quota report /local \; quota report /local-adm \; quota report /local-vs \; quota report /local-vs2.6 \; quota report /nbc \; quota report /fp-cnf \; quota report /tor-adm1 \; quota report /tor-dev1 \; quota report /tor-dev2 \; quota report /tor-fp1 \; quota report /tor-fp2 \; quota report /tor-vs1 \; quota report /tor-vs2 \; quota report /tor-vs3 \; quota report /tor-vs4 \; quota report /tor-vs5 \; quota report /tor-vs6 \; quota report /tor-vs7 \; quota report /tor-vs8 \; quota report /tor-vs9 \; quota report /tor-vs10 \; quota report /tor-vs11 \; quota report /tor-vs12 \; quota report /www-home \; quota report /www1 \; quota report /www2 \; quota report /cgi \; df \; df -i | fgrep -v /.snapshot
In the actual script, the initial "rsh $FILER rdfile /etc/quotas ..." command is backquoted to a variable first, then the variable is eval'd (thus the presence of the \'s). This satisfies two of my requirements: no need for anything besides awk and rsh on your admin host, and no need to have the filer root mounted. I do have to rely on the hidden "rdfile" command to get access to /etc/quotas, but I can live with that for now.
I first tried building a compound rsh command, but our filer had too many qtrees (54 in 2 volumes) so the filer rejected the rsh command line as "too long". That prompted me to put the commands into a file and use the "source" command to run it.
Just something you may need to watch out for as you add qtrees.
I'm running ~5.3.6 on most of my filers, so that command is not
available. I followed the same idea though, and simply had an awk statement construct a compound rsh command to the filer (sorry again... extreme line length warning):
% rsh nbc-na1 rdfile /etc/quotas | awk 'BEGIN { printf "rsh -n $FILER "; } ($2 == "tree") { printf("quota report %s \\; ", $1); } END { print " df \\; df -i | fgrep -v /.snapshot"; }' rsh -n $FILER quota report /depot \; quota report /local \; quota report /local-adm \; quota report /local-vs \; quota report /local-vs2.6 \; quota report /nbc \; quota report /fp-cnf \; quota report /tor-adm1 \; quota report /tor-dev1 \; quota report /tor-dev2 \; quota report /tor-fp1 \; quota report /tor-fp2 \; quota report /tor-vs1 \; quota report /tor-vs2 \; quota report /tor-vs3 \; quota report /tor-vs4 \; quota report /tor-vs5 \; quota report /tor-vs6 \; quota report /tor-vs7 \; quota report /tor-vs8 \; quota report /tor-vs9 \; quota report /tor-vs10 \; quota report /tor-vs11 \; quota report /tor-vs12 \; quota report /www-home \; quota report /www1 \; quota report /www2 \; quota report /cgi \; df \; df -i | fgrep -v /.snapshot
In the actual script, the initial "rsh $FILER rdfile /etc/quotas ..."
command is backquoted to a variable first, then the variable is eval'd (thus the presence of the \'s). This satisfies two of my requirements: no need for anything besides awk and rsh on your admin host, and no need to have the filer root mounted. I do have to rely on the hidden "rdfile" command to get access to /etc/quotas, but I can live with that for now. -- Brian Tao (BT300, taob@risc.org) "Though this be madness, yet there is method in't"
Steve Losen scl@virginia.edu phone: 434-924-0640
University of Virginia ITC Unix Support
On Wed, 10 Oct 2001, Steve Losen wrote:
I first tried building a compound rsh command, but our filer had too many qtrees (54 in 2 volumes) so the filer rejected the rsh command line as "too long".
Yeah, 1024-character limit on a command line. We manage to sneak in under the limit on all of our current filers so far, but I expect I'll have to toss in an xargs-like splitter to issue multiple rsh commands as necessary.
That prompted me to put the commands into a file and use the "source" command to run it.
I don't I would want to use that for my particular script (I don't depend on having the filer's root mounted on the host running the script), but I can think of several other uses for that command once we begin upgrading to 6.x.
I've never tried it, but try tinkering with the qrVTable mib table..
(Following up to myself..) check out:
$ snmpwalk -m all toaster public enterprises.netapp.netapp1.quota.qrVTable enterprises.netapp.netapp1.quota.qrVTable.qrVEntry.qrVIndex.1.1 = 1 enterprises.netapp.netapp1.quota.qrVTable.qrVEntry.qrVType.1.1 = qrVTypeTree(3) enterprises.netapp.netapp1.quota.qrVTable.qrVEntry.qrVId.1.1 = 1 enterprises.netapp.netapp1.quota.qrVTable.qrVEntry.qrVKBytesUsed.1.1 = 4690124 enterprises.netapp.netapp1.quota.qrVTable.qrVEntry.qrVKBytesLimit.1.1 = 12582912 enterprises.netapp.netapp1.quota.qrVTable.qrVEntry.qrVFilesUsed.1.1 = 44 enterprises.netapp.netapp1.quota.qrVTable.qrVEntry.qrVFileLimit.1.1 = 12288 enterprises.netapp.netapp1.quota.qrVTable.qrVEntry.qrVPathName.1.1 = "/vol/vol0/kg_temp" enterprises.netapp.netapp1.quota.qrVTable.qrVEntry.qrVVolume.1.1 = 1 enterprises.netapp.netapp1.quota.qrVTable.qrVEntry.qrVTree.1.1 = "kg_temp" enterprises.netapp.netapp1.quota.qrVTable.qrVEntry.11.1.1 = 1 enterprises.netapp.netapp1.quota.qrVTable.qrVEntry.12.1.1 = "" enterprises.netapp.netapp1.quota.qrVTable.qrVEntry.13.1.1 = 0
I don't normally use quotas, so I can't comment on the delay as opposed to 'quota report' (this qtree is almost entirely empty). However, walking this tree w/ perl's Net::SNMP with a little data massaging should give you some very nice output, and definately be more flexible and portable than the rsh approach.
..kg..
On Mon, 8 Oct 2001, kevin graham wrote:
I don't normally use quotas, so I can't comment on the delay as opposed to 'quota report' (this qtree is almost entirely empty). However, walking this tree w/ perl's Net::SNMP with a little data massaging should give you some very nice output, and definately be more flexible and portable than the rsh approach.
I think I've found an acceptable workaround (see my recent message to Steve Losen) that doesn't require the user to install snmpwalk or Net::SNMP or understand what to do with netapp.mib, etc. I've never really poked at a filer's SNMP port though (except to record system.sysUpTime.0), so this could come in handy later.