ahostli

Active Member
May 28, 2006
40
0
156
OK. Forgive me for saying this but - cPanel/WHM disk usage reporting st*nks. It’s inaccurate, MySQL usage is separated from Quota usage and if you aren’t running phpSuexec - then your clients can have "unlimited" disk space.

I’ve wrote a little script to see the actual disk usage per user (the results were quite interesting - for example - one user ordered account with 500MB disk space and he was actually using ~1,5 GB (WHM displayed only 320MB):

#!/bin/bash
cd /var/cpanel/users
for user in *
do
touch /var/lib/mysql/$user.0034ax
array=(`du -sch /home/$user /var/lib/mysql/$user* `)
len=${#array[*]}
echo "$user : ${array[$len-2]}"
done
Don’t laugh - I’m not a programmer ;)

I was wondering - could someone create a patch to cPanel/WHM, or at least x (x2) theme, to show actual disk usage (not quota usage)? OR - how can I display results (generated by previously mentioned script) on WHM and cPanel?

Sorry for my English ;)
 

ahostli

Active Member
May 28, 2006
40
0
156
OK done on cPanel. Now, can someone tell me where is WHM's Main >> Account Information >> List Accounts script is located?

Thank You in advance
 

elleryjh

Well-Known Member
Apr 12, 2003
475
0
166
I believe the 'list accounts' is located in the WHM binary so I don't think you'll be able to access it.

One alternative would be to write a PHP/Perl script using the cPanel accounting module and then use that list of accounts to run your disk usage script.

Since the du command requires traversing the directory structure, I'd suggest making this a cronjob which updates a database, rather than something that runs in WHM - it would be very slow checking every account.