Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
 
Go Back   Zimbra - Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra - Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-07-2009, 09:03 AM
Member
 
Posts: 10
Default get a random sample of user account growth by month

Here's some perl code that may or may not be useful for someone. It's a script to connect to a ZCS instance, get the number of accounts on that system, randomly select a 99% confidence sample with a 4% margin of error, then output the growth by month of those accounts.

You will need to put a file called "auth.yaml" in the script directory, the format is in the script:
Code:
zimbra_ldap:
 ldaphost: LDAP-HOSTNAME-HERE
 imaphost: IMAP-HOSTNAME-HERE
 binddn: uid=zimbra,cn=admins,cn=zimbra
 bindpass: SOMETHING
 authuser: SOMEONE
 authpass: SOMETHING
Output looks something like:

account@example.com, Oct-2008, 1240517
account@example.com, Nov-2008, 892160
account@example.com, Dec-2008, 418252
account@example.com, Jan-2009, 317260
account@example.com, Feb-2009, 470876
account@example.com, Mar-2009, 1017728

To modify the date range, you'll need to edit the script at line 84 and change "( year => 2008, month => 5 )" to whatever you need.

I like to redirect the output from the script to a .csv file. You can then perform whatever analysis you want

Dependencies:
Code:
use Mail::IMAPClient;
use Data::Dumper;
use List::Util qw(sum shuffle);
use DateTime;
use Net::LDAP;
use Config::YAML;
use MIME::Base64;
Comments, modifications greatly appreciated
Attached Files
File Type: txt message-sample-size.txt (3.3 KB, 0 views)
Reply With Quote
  #2 (permalink)  
Old 10-10-2009, 10:36 PM
Special Member
 
Posts: 164
Default

I don't understand, what is this? and what it can does?
Reply With Quote
Reply


Thread Tools
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

Zimbrablog.com




 

Search Engine Optimization by vBSEO 3.1.0