100-monitor_database_size.inc.php reports always 0 used space
short description
On the ISPConfig main page, on database Quota, Used space is always 0kb
If I run /usr/local/ispconfig/server/cron.sh by hand, 100-monitor_database_size.inc.php says: database c0testdb size does not exceed quota: 26214400 (quota) > 0 (used)
But that's not true. I checked the library and internally it runs a mysql query:
SELECT SUM(data_length+index_length) FROM information_schema.TABLES WHERE table_schema='c0testdb';
that if I run manually on mysql it returns correctly about 40MB :
+-------------------------------+ | SUM(data_length+index_length) |
+-------------------------------+| 41324160 | +-------------------------------+
After some debugging, the problem seems to be in the function getDatabaseSize in file db_mysql.inc.php. It returns always 0
correct behaviour
The database quota size should be reported on the ISPConfig main page 100-monitor_database_size.inc.php should report correct values
environment
Server OS: Ubuntu Server OS version: 14.04.5 LTS Trusty ISPConfig version: 3.1dev e2465bd7
apachectl -v Server version: Apache/2.4.7 (Ubuntu) Server built: Apr 18 2018 15:36:26
PHP 5.5.9-1ubuntu4.26 (cli) (built: Sep 17 2018 13:46:30) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies with XCache v3.1.0, Copyright (c) 2005-2013, by mOo with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies with XCache Optimizer v3.1.0, Copyright (c) 2005-2013, by mOo with XCache Cacher v3.1.0, Copyright (c) 2005-2013, by mOo with XCache Coverager v3.1.0, Copyright (c) 2005-2013, by mOo