MySQL database quota/usage tracking

Discussion in 'General' started by dmgeurts, Oct 17, 2016.

  1. dmgeurts

    dmgeurts Member

    Successfully graphing apache vhost bandwidth, diskspace and disk quota usage. I'm now looking at mysql tracking per database. I'd like to graph DB usage and bandwidth. In order to do so I need to better understand how ISPconfig 3.1 implements the SQL quota.

    Suggestions on how to best go about feeding this information to a monitoring process is welcome too but I'm sure I can work that out as long I have a way to scrape or probe the system to obtain the raw information.
     
  2. Ryan Rajpoot

    Ryan Rajpoot New Member

    I have problem in using mysql too, suggest me any guide tutorial though which i learn...
     
  3. florian030

    florian030 Well-Known Member HowtoForge Supporter

    The SQL-Quota is read from mysql. See function getDatabaseSize in server/lib/classes/db_mysql.inc.php.
    The current quota is stored in the database: server/lib/classes/cron.d/100-monitor_database_size.inc.php
    If you need a graph for the db-quota either fetch the data according to the function getDatabaseSize or parse the old data before it's get updated and adjust the cron-class.
     
    dmgeurts likes this.
  4. dmgeurts

    dmgeurts Member

    @florian030 Very helpful information, thank you. Looking at those two files, getDatabaseSize requires the database name and monitor_database_size writes a complete array. Seems easier to read the array at regular intervals. It should allow for a single query to provide a list of databases and the related stats. Statistical data doesn't need to be (absolute) real time so will likely go that route, plus it keeps any scripting independent of ISPConfig internal functions so less likely to break things.
     
  5. dmgeurts

    dmgeurts Member

    Ryan, not sure what you're stuggling with. If it's not the same query, I suggest you create a new thread.
     

Share This Page