Quota violation… cha cha cha !


I received a request earlier this week with regard to some issues a customer is having with users blowing their quota, then blaming internal IT because they cannot access their mailbox… Well that just burns my a$$, I really cannot stand misplaced blame… Blame the RIGHT people !!! Especially from people who darn well know that they have disk allocation limitations… Of course there is no “canned” report built in to the GUI that manages this gateway product so off to the command line I went… Seemingly a simple one-liner turned into a bit more of a research project than I had expected… I guess I didn’t know as much as I thought about cyrus, if you recall from cyrus… you bastard !, I didn’t know anything back then either… I am making an assumption here, but I think that the client will want this in some sort of weekly email report… so I will probably end up setting up a cron job to run this… Oh well practice makes perfect, or at least close in this case.  Below you will find my simple little one-liner… and an example of its output 🙂

#!/bin/bash
# Find the Top 25 quota users
echo ""
echo "   --------------------------------------"
echo ""
echo "   Top 25 IMAP users by quota utilization"
echo "        `date`                           "
echo ""
echo "   --------------------------------------"
echo ""
echo "  Defined     %       KB     "
echo "   Quota    Used    Used User"
echo "   --------------------------"
su -c '/usr/lib/cyrus-imapd/quota -f' cyrus|sort +1 -nr|head -n25

Sample output:

 --------------------------------------

 Top 25 IMAP users by quota utilization
     Thu Jun 17 16:28:09 EDT 2010

 --------------------------------------
Defined     %      KB
 Quota    Used    Used User
 --------------------------
 51200     107   54974  user/tcostner
 51200     105   54181  user/hwillis
 51200     103   52863  user/jbrown
 51200     102   52386  user/gturner
 51200     101   51950  user/rburton
 51200     100   51480  user/ldrzewucki
 51200     100   51236  user/ktunis
 51200     100   51223  user/wrogers
 51200     100   51212  user/kgiancarlo
 51200     100   51205  user/charris
 51200     100   51203  user/wdavis
 51200      97   49877  user/jcooke
 102400     96   98635  user/rertel
 51200      94   48194  user/asischo
 51200      90   46437  user/ahester
 51200      90   46396  user/tturner
 51200      89   45856  user/afareed
 51200      86   44390  user/ldiggs
 51200      84   43423  user/kbrown
 512000     84   434653 user/lgreen
 204800     80   165309 user/lfreidenberg
 51200      78   40205  user/vbrown
 51200      78   40195  user/jrozier
 51200      77   39654  user/pbanaszak
 204800     77   158253 user/aviverette
Advertisements

, , , , , , , ,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: