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

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 Search this Thread Display Modes
  #1 (permalink)  
Old 03-12-2009, 07:06 AM
Active Member
 
Posts: 34
Default [SOLVED] Monthly messages report?

Hi guys
sup?

I recieve daily messages report from my server... i need this statistics moth, its is possible?

Thanks mans...
Reply With Quote
  #2 (permalink)  
Old 03-12-2009, 09:10 AM
Moderator
 
Posts: 927
Default

Hello halley, welcome to the forum. Could you clarify your question a little as I dont quite understand it. Thanks.
Reply With Quote
  #3 (permalink)  
Old 03-12-2009, 10:06 AM
Active Member
 
Posts: 34
Default

Quote:
Originally Posted by Dirk View Post
Hello halley, welcome to the forum. Could you clarify your question a little as I dont quite understand it. Thanks.

I would like to know the possibility of having the monthly number of how many messages come and go. Currently receive an e-mail messages daily from, I wanted the monthly total.

Thanks
Reply With Quote
  #4 (permalink)  
Old 03-12-2009, 10:24 AM
Moderator
 
Posts: 6,237
Default

The arguments to zmdailyreport include:
--user <email_address> Report usage for <email_address> only
--mail Send report via email, default is stdout
--now Shortcut for midnight to the current time
--time <start>,<end> Default is midnight to midnight of the previous day
Start and end times must be in YYYYMMDD[hhmmss] format

So you can either-
A) Run it manually:
Quote:
cd /opt/zimbra/libexec
./zmdailyreport -m -t start,end
Comma included or it wont find the end time.
./zmdailyreport -m -t 20090301112233,2009031211223

You also don't have to be that specific:
./zmdailyreport -m -t 2009,20090312

B) Modify cron:
su - zimbra
contab -e (opens in vim)
Quote:
# Daily reports
#
10 1 * * * /opt/zimbra/libexec/zmdailyreport -m
You'll want to put in values for -t such that it's auto (make yourself a $datefirstmonth & $datecurrent)

C) Modify /opt/zimbra/libexec/zmdailyreport default to contain *720 or an extra *30 (or so):
Quote:
# usage: getTimes( now => $Opt{now}, time => $Opt{time} )
sub getTimes {
my %arg = @_;

my ( $start, $end );
if ( $arg{time} ) {
( $start, $end ) = split( /\s*,\s*/, $arg{time} );
$start = timeToSqlTime($start);
$end = timeToSqlTime($end) if ($end);
}
elsif ( $arg{now} ) {
$start = tsToSqlTime( time(), 1 );
$end = tsToSqlTime( time(), 0 );
}
else { # default to the previous day
$start = tsToSqlTime( ( time() - ( 60 * 60 * 24 ) ), 1 );
$end = tsToSqlTime( time(), 1 );
}
return ( $start, $end );
Keep in mind it checks the logger DB, so the results you get are going to be limited by:

zimbraLogRawLifetime (default 31d) - lifetime (nnnnn[hmsd]) of raw log rows in consolidated logger tables
zimbraLogSummaryLifetime (default 730d)- lifetime (nnnnn[hmsd]) of summarized log rows in consolidated logger tables

Adjust with: zmprov mcf zimbraLogAttribute Xd

Last edited by mmorse; 03-12-2009 at 10:37 AM.. Reason: note ,
Reply With Quote
  #5 (permalink)  
Old 03-12-2009, 10:34 AM
Moderator
 
Posts: 6,237
Default

I should clarify the comma is important or it wont find the end time.
Quote:
A) Run it manually:
cd /opt/zimbra/libexec
./zmdailyreport -m -t 20090301112233,2009031211223
You also don't have to be that specific:
./zmdailyreport -m -t 2009,20090312
Reply With Quote
  #6 (permalink)  
Old 03-12-2009, 11:00 AM
Active Member
 
Posts: 34
Default

Work Fine man... very thanks... very...

Last edited by halley; 03-12-2009 at 11:34 AM..
Reply With Quote
  #7 (permalink)  
Old 03-12-2009, 02:16 PM
Moderator
 
Posts: 6,237
Default

Quote:
Originally Posted by halley View Post
Edit: Work Fine man... very thanks... very...
Cool
Quote:
Originally Posted by halley View Post
Thanks Mmorse, i exec this command [zimbra@mail libexec]$ ./zmdailyreport -m -t 20081219000000,20090311000000

and not recieve any result, this send mail for admin@mail.com ? Thanks man
Without -m presents it to your console/stdout.

Specifying -m sends it to the email specified in localconfig:
zmlocalconfig -e smtp_destination=admin@domain.com

Also relevant to that is:
smtp_source=admin@domain.com (the from)
smtp_notify=yes
zimbra_mtareport_max_recipients=50
zimbra_mtareport_max_senders=50
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.