getting the mailbox traffic / checking quota

Discussion in 'Developers' Forum' started by weezul, Jul 7, 2012.

  1. weezul

    weezul New Member

    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

    // $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.
    Last edited: Jul 7, 2012
  2. till

    till Super Moderator Staff Member ISPConfig Developer


    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.

    The api runs with admin user priveliges and one of the priveliged of the admin user is to overrde client quotas.
  3. weezul

    weezul New Member

    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 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.
    Last edited: Jul 8, 2012
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    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.

Share This Page