Connect. Communicate. Collaborate. Securely.

Home » Kerio User Forums » Kerio Connect » User Count Per Domain and mail box size per user (Mail box count per domain)
  •  
ETSkerio

Messages: 7
Karma: 0
Send a private message to this user
Hi, for those that are hosting Kerio, is there a way to get reports:

a) number of mail box per domain
b) mail box usage size per user per domain?

I am running on Linux.

Thanks for your help,
Bora
  •  
TorW

Messages: 769
Karma: 9
Send a private message to this user
If you're comfortable with scripting and sed, yes. See here. Note that this is a kludge. If you have a mix of external (AD/OD) and internal users, the whole thing becomes even more inelegant. Probably not what you were after, but still ...

We're using something based on this method to mail ourselves daily reports on quota usage and export a list of accounts to an external antivirus/antispam gateway.
  •  
JohnGL

Messages: 1
Karma: 0
Send a private message to this user
Rough one-liner for you.
Replace /mailraid/mailraid/mail with your corresponding path.
I included mailing lists as they count towards user licenses, and removed the #public folders from the tally and display.


# cd /mailraid/mailstore/mail ; for a in ./*; do  echo -e "\n`ls -ld $a/* | egrep -v "#" | wc -l` mailboxes in $a\n`ls -ld ../lists/$a/* | egrep -v "#" | wc -l` lists in $a\n"; du -hc --max-depth=1 $a | egrep -v "#"; done
  •  
ETSkerio

Messages: 7
Karma: 0
Send a private message to this user
Hi, thank you for your replies. Follow up questions:

1. For both scripts, can it saves the result to text file and email out? I like to have run as cron job and email out on daily basis?

2. How do you get disk quota count?

3. What OS are the scripts been tested? I am currently running Linux CentOS in ESX virtual appliance. Does XMLstartlet work on CentOS, b/c RPM is Mandrake?

Thanks,
Bora
Smile


[Updated on: Tue, 13 July 2010 00:31]

  •  
ETSkerio

Messages: 7
Karma: 0
Send a private message to this user
Hi John,

I tested your script and it provide the result I need.

1. How can i make it into a sh script?
2. How do I save the output into a test file?

I want to get the result email to me?

Thanks,
Bora
  •  
TorW

Messages: 769
Karma: 9
Send a private message to this user
Output to a file is by standard means, i.e. the ">" redirector. To mail the result, pipe it through the mail command or use redirection:

mail -s "Userlist mailing" recipient<_at_>example.com < outputfile.txt


The mail will come from root<_at_>host.example.com.

The allocated disk quota is stored in the "Qstorage" variable in users.cfg, so include it in the xmlstarlet query. The actual spent amount of disk quota is tucked away in a line the file stats.usr in each user folder. The value is (for some reason) in lower case hexadecimal. Here's how I lure it out in the open and convert it to decimal:

QTMP=`grep "^S" $MAILSTORE/$DOMAIN/$UNAME/stats.usr | tr -d "[:cntrl:]S-" | tr [:lower:] [:upper:]`
QSPENT=`echo "ibase=16;$QTMP"|bc`


The $MAILSTORE, $DOMAIN and $UNAME variables should be self explanatory. This is standard shell (sh) scripting and should work on any Linux distribution. PLEASE test everything on a backup of the config files before going live.
  •  
ETSkerio

Messages: 7
Karma: 0
Send a private message to this user
Thank you for your reply. When I use the mail command, I get a noticed "bad address". I have the correct email address, I don't why.

Sendmail is there, is there additional configuration needed for it to work? I am running on Linux CentOS.

Quote:
# mail -s "test" admin<_at_>domainname.com < usercount.log
Bad address

[Updated on: Tue, 13 July 2010 18:13]

  •  
TorW

Messages: 769
Karma: 9
Send a private message to this user
ETSkerio wrote on Tue, 13 July 2010 18:12
Sendmail is there, is there additional configuration needed for it to work?


No mail servers "just work", so yes. Based on the fact that you're asking at all, the answer is well beyond the scope of this forum (and my spare time). But try to send mail as root, and also check that the config will let you send mail to external addresses.
  •  
ETSkerio

Messages: 7
Karma: 0
Send a private message to this user
Thank you for all your help.

Aside question:

If you are hosting Kerio, do you have automated process to track storage quota and user account increase? Our current process requires to look at the last billing then add the addtional storage usage or user count. It works but time consuming.
  •  
TorW

Messages: 769
Karma: 9
Send a private message to this user
Apart from the flatfile email address export to our gateway, we have two administrative lists coming out of KMS (we run 6.7.x):


  1. Daily: a list of all accounts that are above 85% quota. Anyone over 90% get their quota increased provided the contract allow it (most do). Others must clean up their inbox themselves.
  2. First day of the month: a list with all accounts and their current quota in MB. This flat file is pasted into a spreadsheet (a simple thing with some VLOOKUP formulas) and compared to last month's quotas. Anyone with an increase have their monthly disk space bill adjusted.


Adjusting the monthly bill is done every third month since the individual price increase is so small. We also bill the time spent adjusting the quota. It's not hard to insert the data into some kind of database and be elegant about it, but a simple spreadsheet works for us since we don't have that many customers/mail accounts. I imagine a mysql db using the primary mail address as an index field would handle this quite nicely, wrapped in some PHP code. I just can't be arsed to write it Wink
Previous Topic: Syncing Calendar to Samsung Acclaim
Next Topic: Kerio Connector / Shared Calendar on Outlook 2003
Goto Forum:
  


Disclaimer:
Kerio discussion forums are intended for open communication between forum members and may contain information and material posted by members which may be useful in learning about Kerio products. The discussion forums are not intended to provide technical support for any specific product. Any information implied or expressed in the discussion forums is that of the posting member. Kerio is in no way responsible for the information posted in the forums, or its accuracy. Kerio employees may participate in the discussions, but their postings do not represent an offical position of the company on any issues raised or discussed. Kerio reserves the right to monitor and maintain the forums to promote free and accurate exchange of information.

Current Time: Fri Nov 24 08:42:29 CET 2017

Total time taken to generate the page: 0.00482 seconds
.:: Contact :: Home ::.
Powered by: FUDforum 3.0.4.