ECSC / analogi

Graphical Web Interface for OSSEC
GNU General Public License v3.0
72 stars 35 forks source link

Database size is zero when name is not ossec #4

Closed ChristianBeer closed 11 years ago

ChristianBeer commented 11 years ago

My productive ossec database is named "ossecdb" and this leads to a 0 MB size in the Management screen. I fixed this by using the DB_NAME_0 define but this probably won't fix it for other configurations with more than one database.

php/management_databasesize.php:

$query = "SELECT table_schema as 'Database', sum( data_length + index_length ) / 1024 / 1024 as 'Size' 
    FROM information_schema.TABLES 
    WHERE table_schema='".DB_NAME_O."'
    GROUP BY table_schema";
ECSC commented 11 years ago

Good find !! Yes I think this will only affect people with custom installs, so hopefully not too many people. I have patched the code here, it should be in the next release (though no immediate plans for one any time soon).

Thanks Christian :)