What more could you want?
Calculate Mail Bandwidth Usage in Plesk
Here’s a little command line hack that will calculate the bandwidth for all maillogs on your Plesk server, for SMTP, and POP/IMAP send and receive:
(echo “smtp: `(cat maillog maillog.processed && zcat maillog.processed.*) | grep bytes | grep qmail: | awk ‘{sum=sum+$11} END { print sum}’`” && (cat maillog maillog.processed && zcat maillog.processed.*) | grep pop3 | grep LOGOUT | awk ‘{print $13,$14}’ | sed ‘s/,//g;s/….=//g’ | awk ‘{sumrcvd=sumrcvd+$1; sumsent=sumsent+$2} END {print “rcvd: “,sumrcvd,”\n” “sent: “,sumsent}’) | awk ‘{total=total+$2; print} END {print “total: “,total/1024/1024 “MB”}’
Run it from /usr/local/psa/var/log. It outputs something along these lines:
smtp: 397852373
rcvd: 228219
sent: 211813204
total: 581.64MB
Enjoy!
/cs
| Print article | This entry was posted by chuck on November 4, 2009 at 12:04 am, and is filed under Uncategorized. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |