#!/bin/sh
#
#lists disk usage by user
echo 'Web Site Files'
du -chs /var/www/vhosts/<THEDOMAIN.COM>/httpdocs/* | tail -1
echo
echo 'Web Users'
du -chs /var/www/vhosts/<THEDOMAIN.COM>/web_users/* | tail -1
du -sk /var/www/vhosts/<THEDOMAIN.COM>/web_users/* | sort -nr | awk '{ print $2 }' | while read f ; do du -sh "$f" | awk -F/var/www/vhosts/<THEDOMAIN.COM>/web_users/ '{ print $1, "\t", $2 }' ; done
echo
echo 'Mail Users'
du -chs /var/qmail/mailnames/<THEDOMAIN.COM>/* | tail -1
du -sk /var/qmail/mailnames/<THEDOMAIN.COM>/* | sort -nr | awk '{ print $2 }' | while read f ; do du -sh "$f" | awk -F/var/qmail/mailnames/<THEDOMAIN.COM>/ '{ print $1, "\t", $2 }' ; done
psaadm ALL = NOPASSWD: /usr/local/sbin/hogs
<style type="text/css">
pre {
font-family: tahoma, arial, verdana, sans-serif;
font-size: 12px;
line-height: 16px;
}
</style>
<div style="margin-left:100px;">
<div style="width:375px; float:left;">
<?
$hogs = shell_exec('sudo /usr/local/sbin/hogs');
echo 'Usage for <THEDOMAIN.COM>';
echo "<pre>$hogs</pre>";
?>
</div>
</div>
Did you change /var/www/vhosts/thedomain.com/httpdocs/ to reflect your domain name? (change thedomain.com to whatever your domain is)hi there, thanks first for your help but i'm still having trouble. the script returns
domain.com
Mail Users
0 tota
also i try modifying iindex.php the line of sudo to sh but same result. permission are 644 for this archive and user root. i believe that something is stopping the shell_exec. the php.ini has no restriction on it .. any idea ? also the sudoers is ok
it gives me the list ok. i think something is happening with the variable coz it displays me
domain.....com
Mail Users
with nothing here
i refer in the index.php when it seems that the shellexec comand does not file. we re using plesk 10.1.1
<?
$hogs = shell_exec('sudo /usr/local/sbin/hogs'); this line is not working and i have no idea why also try sh /usr/local
echo 'domains.com';
echo "<pre>$hogs</pre>";