HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Developers' Forum (http://www.howtoforge.com/forums/forumdisplay.php?f=33)
-   -   getting the mailbox traffic / checking quota (http://www.howtoforge.com/forums/showthread.php?t=57857)

weezul 7th July 2012 23:43

getting the mailbox traffic / checking quota
 
hello, i looked through the remoting lib and didn't find an example to get the mailbox traffic, also i noticed that when i create a mailbox the quota of the mailbox isn't checked against the client mailbox quota, so i guess i have to handle this myself.

regarding the mailbox traffic, can i query the db just with

Code:

// $sql = "SELECT * FROM mail_traffic";
// $app->db->queryAllRecords($sql)

to get all records or won't that scale if there are more servers?

how does ispconfig handle scaling, does it store the user information seperately on each server and does the adminpanel just pull everything together or does it keep all information on the "master" server ?

to my quota issue, i thought about storing the quota limits in my application, which i think is a bead idea because if anything changes over the ispconfig panel my data would be inconsistent, so i guess i've to write a sql query to do the check for me which brings me back to my previous question.

till 8th July 2012 12:15

Quote:

regarding the mailbox traffic, can i query the db just with

Code:
// $sql = "SELECT * FROM mail_traffic";
// $app->db->queryAllRecords($sql)
to get all records or won't that scale if there are more servers?
Yes.

Quote:

how does ispconfig handle scaling, does it store the user information seperately on each server and does the adminpanel just pull everything together or does it keep all information on the "master" server ?
Config data is mirrored on the slaves to avoid a single point of failure and traffic data is accumulated on the master to allow traffic accounting for mirrored servers. So systems that consist of a few hundred servers are no problem at all. If you scale into thousands of servers then it might be nescessary to run the master system on a mysql cluster where a few hundred ispconfig nodes are attached to each node of the cluster. The ispconfig slaves use still single mysql instances as they were only used for config data caching.

Quote:

also i noticed that when i create a mailbox the quota of the mailbox isn't checked against the client mailbox quota, so i guess i have to handle this myself.
The api runs with admin user priveliges and one of the priveliged of the admin user is to overrde client quotas.

weezul 8th July 2012 17:48

hello till,

thanks for your response, so i can just pull out everything of the masters sql db and should be fine then.

another question :)

i would like to know if it's possible to update the monitor_data table in order to see if things changed, when i create a new mailbox, login and run the cron_daily.sh it just prints inserts into mail_traffic to stdout, the monitor_data stays unchanged. is there an other script involed or is this handled by postfix somehow? would be great if i could update the data in those tables for testing purposes.

till 9th July 2012 10:31

The cron_daily script is the only script involved, like the name says, its is a daily script and will not work if you run it manually at another time as the log files and other data required for this script to work correctly might not exist yet at the moment were you had run it manually. Also running it manually more then once per day will corrupt the statistics.


All times are GMT +2. The time now is 00:13.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.